Regex Tester - Real-Time Pattern Matching
Test JavaScript regular expressions with live match highlighting, capture groups and g/i/m/s flags. A free, private regex tester that runs in your browser.
Pattern Matcher
About Regex Tester
Our Regex Tester is a free, client-side utility that lets you write regular expressions and instantly see matches highlighted in your test text. Because it runs entirely in your browser, you can safely test regex patterns against proprietary logs or sensitive data strings without any data leaving your machine.
Features
- Real-time match highlighting as you type
- Toggle flags: global, case-insensitive, multiline, dotAll
- Capture group extraction and display
- 100% client-side — safe for sensitive data
How to Use
- Type your regular expression in the pattern field
- Toggle the flags (g, i, m, s) as needed
- Enter or paste your test string below
- Matches are highlighted instantly in the results panel
How the Regex Tester works
Your pattern goes straight to the RegExp object built into your browser, so you get ECMAScript syntax: lookaheads, lookbehinds and named groups such as (?<year>\d{4}). On Chrome or Edge, that is the same V8 engine Node.js uses.
About 120 milliseconds after you stop typing, the tool re-runs the pattern over the whole test string. It always scans globally, adding the g flag itself if the chip is off, so every match is coloured either way. The i, m and s chips do change the result. Match Details then lists each match with its index range and capture groups, up to 5,000 matches.
The text you test against is often the sensitive part: an access log full of customer IP addresses, or a CSV export of support tickets. None of it is sent anywhere. Your pattern and test string are saved in this browser’s local storage so they survive a reload, so press Clear when you finish on a shared computer.
When to use the Regex Tester
- Pulling request paths out of an Nginx log line with a pattern like
"(GET|POST) ([^ ]+). - Trying a phone number validator against awkward real input such as
+92 300 1234567before you ship the form. - Working out why
String.prototype.match()returns null in your front-end code. - Checking which addresses an email pattern catches, starting from the one Try Sample loads.
What the Regex Tester can’t do
It speaks JavaScript’s flavour only. In our tests, these PCRE and Python constructs were all rejected as invalid: possessive quantifiers (a++), atomic groups ((?>a)), inline flags ((?i)) and Python-style named groups ((?P<name>a)). A pattern headed for PHP, Python or an Nginx config needs a final test in that engine.
It offers four flags: g, i, m and s. With no u chip, Unicode property escapes don’t work the way you expect. \p{L} won’t match é, because without u the engine reads it as the literal text p{L}.
There is no replace mode and no pattern explainer, and Match Details lists named groups by number.
A runaway pattern can freeze the tab.
Matching runs on the browser’s main thread with no timeout. In our test, (a+)+$ took six seconds against 26 letters and a mismatch at the end, and each extra letter roughly doubles that.
Frequently Asked Questions
Is my test data sent to a server?
No. Matching runs in your browser with JavaScript's native RegExp engine, and no test data is transmitted. Your pattern and test string are saved in this browser's local storage so they survive a reload. Press Clear when you finish on a shared computer, and that saved copy is wiped.
Which regex flavor does this tool use?
It uses the ECMAScript flavour built into your browser's JavaScript engine, so lookaheads, lookbehinds and named capture groups all work. Patterns here behave as they will in your front-end code. Languages with other engines, such as PHP, Python and Go, differ in places, so test there before you ship.
What are Regex flags?
Flags change how a pattern behaves. Here, i ignores case, m makes ^ and $ match at line breaks, and s lets the dot match newlines. The g flag normally means find every match, but this tool always highlights every match, so switching g off changes nothing on screen.
What are capture groups?
Wrapping part of a pattern in parentheses creates a capture group, which pulls out that portion of each match. In (\w+)@(\w+\.\w+), group 1 is the name and group 2 is the domain. Match Details lists the groups by number, even when you have given them names.
Why is my regex not matching anything?
Common causes are a missing i flag, unescaped special characters such as dots and brackets, or invisible whitespace in the test string. Python's (?P<name>...) syntax also fails here, with an error banner. Shorten the pattern until something matches, then add pieces back and watch Match Details as you go.
Does this regex tester work for Python or PHP patterns?
Partly. Basic syntax is shared, but this tester uses JavaScript's engine. PHP's possessive quantifiers and atomic groups, and Python's (?P<name>...) groups, are rejected as invalid. Patterns that do compile can still behave differently in another engine, so treat a pass here as a first check and confirm it in your own language.