Regex Tester
Build and debug regular expressions with real-time match highlighting, capture group details, substitution preview, and plain-English token explanations. Runs entirely in your browser — no patterns are sent to a server.
Pattern breakdown
Enter regex pattern…
Guide
How to Use
- 1 Choose your engine
Select JavaScript, PCRE2, or Python re from the flavour control at the top. The available flags update automatically to match the chosen engine.
- 2 Enter a pattern
Type your regex pattern in the input field between the / delimiters. The flags display updates as you toggle flag buttons. Press Copy (⧉) to copy the full /pattern/flags string.
- 3 Test against text
Enter or paste your test text in the large text area. Matches are highlighted in real time with numbered badges so you can distinguish multiple matches at a glance.
- 4 Inspect match details
Click any match in the details accordion below the text area to see its exact position (start–end offset) and any capture group values, including named groups.
- 5 Preview substitutions
Switch to the Substitution tab, enter a replacement string, and see the full substituted text instantly. Use back-reference syntax ($1, \1, or \g<name>) appropriate for your chosen engine.
- 6 Understand your pattern
Open the Explanation tab for a token-by-token breakdown of what each part of your pattern does. Use the Quick Reference cheatsheet on the Match tab for a searchable token reference.
How to Use
- Choose an engine: JavaScript, PCRE2, or Python re.
- Enter a pattern in the / … / field.
- Type or paste test text to see matches highlighted live.
- Expand a match to view capture group details.
- Use the Substitution tab to preview replacements.
Reference
Engine Feature Comparison
| Engine | Named groups | Lookbehind | Unicode | Verbose | Back-references |
|---|---|---|---|---|---|
| JavaScript | Yes | Yes | Yes | No | Yes |
| PCRE2 | Yes | Yes | Yes | Yes | Yes |
| Python re | Yes | Yes | Yes | Yes | Yes |