Regex Tester
Write a regular expression, choose flags, test it against sample text, inspect matches and capture groups, and preview replacements.
Runs locally in your browser. Your data never leaves your device.
Inputs
Results
- Matches
- 2
- Status
- OK
- hello@example.comIndex 8 · 0 capture group(s)
- support@example.orgIndex 29 · 0 capture group(s)
Matches update as you edit the pattern, flags, or text.
How to test a regular expression
Test a JavaScript regular expression against real text, inspect matches and capture groups, and preview replacement output.
How to use it
- Enter the regex pattern without surrounding slashes.
- Add flags such as g, i, or m when needed.
- Paste the text you want to test.
- Review the match count, match positions, capture groups, and replacement preview.
Useful checks
Regex testers are useful for validating form patterns, cleaning log data, preparing search-and-replace rules, and debugging capture groups before they go into code.
Debugging tips
- Start with a small sample before testing a long document.
- Add the g flag when you want all matches.
- Use capture groups to confirm which part of the match you will reuse.
Local testing
Patterns and test text run through your browser's JavaScript RegExp engine and are never sent to a server.
Regex tester FAQ
- Which regex flavor does this use?
- It uses JavaScript regular expressions, the same flavor used by modern browsers.
- Why does a valid regex from another language fail?
- Regex syntax differs between engines. A pattern from PCRE, Python, or Java may need small changes for JavaScript.
- Does it limit matches?
- Yes. The preview stops after 200 matches so a runaway pattern does not overwhelm the page.
