Pattern
Build a regular expression
//
Developer utility
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.
Pattern
Match list
| # | Match | Start | End | Length | Groups |
|---|
Capture groups
| Match | Group | Value | Start | End |
|---|
Preview
Replace
Examples
| 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 |
It uses the native JavaScript RegExp engine in your browser, including supported modern flags and named capture groups.
Yes. Enable the d flag to show start and end indices for numbered and named capture groups.
Some expressions cause catastrophic backtracking. The tester stops worker execution after one second to keep the page responsive.
No. Compilation, matching, highlighting and replacement happen locally in your browser.