Pattern
Developer utility
Regex Tester
Test JavaScript regular expressions with live matches, numbered and named captures, exact indices, highlighted text and replacement output. Risky matching runs in a timeout-protected browser worker.
Match list
Matches and positions
| # | Match | Start | End | Length | Groups |
|---|
Capture groups
Numbered and named groups
| Match | Group | Value | Start | End |
|---|
Preview
Highlighted test text
Replace
Test replacement output
Examples
Common regex tests
Regex quick reference
| Token | Meaning | Example |
|---|---|---|
. | Any character except a line terminator unless dotAll is enabled. | a.c |
\d | Decimal digit character. | \d{4} |
\w | ASCII letter, digit or underscore in JavaScript regex. | \w+ |
+ | One or more of the previous token. | \w+ |
* | Zero or more of the previous token. | .* |
? | Optional token or lazy quantifier marker. | https? |
() | Numbered capture group. | (\d{4})-(\d{2}) |
(?<name>...) | Named capture group. | (?<year>\d{4}) |
^ / $ | Start and end anchors. | ^Title |
\b | Word boundary. | \bcat\b |
JavaScript regular expression notes
Regex tester FAQ
Which regular expression flavor does this tool use?
It uses the native JavaScript RegExp engine in your browser, including supported modern flags and named capture groups.
Can I inspect capture positions?
Yes. Enable the d flag to show start and end indices for numbered and named capture groups.
Why does a pattern time out?
Some expressions cause catastrophic backtracking. The tester stops worker execution after one second to keep the page responsive.
Does the tester send my pattern or text to a server?
No. Compilation, matching, highlighting and replacement happen locally in your browser.
Handy Tool Lab
How this tool is maintained
Handy Tool Lab builds and tests each tool around repeatable examples. Formula-based tools use published references when a suitable source exists; browser utilities are checked with representative inputs and output cases.