How to use the regex tester
- Type a pattern — with or without surrounding slashes — in the Pattern box.
- Select flags such as
g(global) ori(ignore case). - Paste your test text. Every match is highlighted instantly and listed below with its capture groups.
- Results update live; there is no button to press.
Common patterns
| Pattern | Matches |
|---|---|
| \d | a digit (0–9) |
| \w | a word character (A–Z, a–z, 0–9, _) |
| \s | whitespace (space, tab, newline) |
| . | any character except newline |
| [a-z0-9] | any character in the set |
| [^0-9] | any character NOT in the set |
| ^ … $ | start / end of string (or line with m) |
| a* a+ a? | zero-or-more / one-or-more / zero-or-one |
| a{2,4} | between 2 and 4 repetitions |
| (abc) | capturing group |
| (?:abc) | non-capturing group |
| (?<name>abc) | named group (read as match.groups.name) |
| \b | word boundary |
| cat|dog | alternation — "cat" or "dog" |
Frequently asked questions
Which regex flavor does this use?
This tester uses the JavaScript (ECMAScript) regex engine — the same one that powers RegExp in Node.js and modern browsers. If you are writing patterns for Python, PCRE or grep, most basics are identical, but advanced syntax can differ.
Why are no matches shown even though the pattern looks right?
Three common causes: the pattern requires the g flag to report more than one match, whitespace in your pattern or text is unexpected, or you are using look-behind/named-group syntax that needs the u flag. Turn on flags one at a time and watch the error line below the pattern box.
What do capture groups do?
Parentheses capture a portion of the match so you can extract it later. For example (\w+)@(\w+)\.(\w+) captures the local part, domain and TLD of an email separately. This tester lists every group for every match so you can verify them at a glance.
Can a pattern freeze this page?
Yes — a poorly written pattern can cause "catastrophic backtracking", which can make the browser tab unresponsive. If that happens, close the tab or stop the script when prompted, then simplify the pattern (avoid nested quantifiers like (a+)+). Patterns run locally, so only your own tab is affected.
Is the test text uploaded anywhere?
No. Matching happens entirely in your browser's JavaScript engine. Nothing you type is transmitted.