Regex Tester
Test regular expressions in real time with capture groups and replace mode.
How to use
- Type or paste your regex pattern and flags.
- Enter the sample text to match against.
- Review highlighted matches and capture groups.
- Optionally switch to replace mode to preview substitutions.
About this tool
Regex Tester is a fast playground for writing and debugging regular expressions. It highlights matches as you type, lists every capture group, and offers a replace mode so you can prototype search-and-replace operations before committing them to code.
Features
Real-time matching, support for all JavaScript flags, named and numbered capture groups, a replace preview with backreferences, and clear error messages when a pattern fails to compile. Long inputs are scrollable and matches stay synchronised with the cursor.
Use cases
Validating form inputs, extracting data from log files, crafting find-and-replace rules for editors, building URL routing patterns, and teaching regex concepts to teammates with a visual aid.
Why choose this tool
All evaluation happens in the browser for instant feedback and complete privacy. The layout is designed for iteration: tweak the pattern, watch the highlights update, and copy the final expression directly into your source code.
FAQ
- Which regex flavour is supported?
- The tool uses the JavaScript engine, so it follows ECMAScript syntax including sticky, unicode, and dotAll flags.
- Can I see named capture groups?
- Yes. Named groups appear in a table alongside positional groups for each match.
- Does it explain my regex?
- Matches are listed with indices and captured substrings, helping you understand how the pattern behaves against different inputs.