Regex Tester
Preview both JavaScript regex match results and replacement results in one page.
Test text
Enter a regular expression to start testing
No matches yet
Help
Preview both JavaScript regex match results and replacement results in one page.
Show details
Two preview modes
- Match mode shows matches, capture groups and named groups.
- Replace Preview mode shows the transformed output without overwriting the source input immediately.
JavaScript Regex Examples
- Test a JavaScript regex online: enter `\d+` to find numeric values in sample text, then enable the flags required by the source.
- Preview a regex replacement: switch to Replace Preview, provide replacement text, and inspect the transformed output before copying it.
- Use parentheses such as `(\w+)@(\w+)` to inspect numbered capture groups in every match.
- Use a named group such as `(?<year>\d{4})` when the capture should remain understandable in match details.
Notes
- The engine follows JavaScript regex semantics rather than PCRE or other runtime-specific extensions.
