Regex Tester & Debugger
Test regular expressions against sample text, inspect matches and capture groups, and preview replacements. Processing happens locally in your browser.
Enter the pattern without surrounding slash marks. Example: \b\d{4}\b
Ready to test your pattern.
Highlighted text
Matched portions are highlighted below. If there are no matches, the original text is shown.
Your highlighted results will appear here.
Match details
Run a test to see match count and positions.
| # | Full match | Index | Capture groups |
|---|---|---|---|
| No results yet. | |||
Replacement preview
Use JavaScript replacement syntax such as $& (full match), $1 (capture group), or $$ (literal dollar sign).
Replacement preview will appear here.
How to use the Regex Tester
- Enter a regular expression pattern without the surrounding slash marks.
- Choose flags such as global, ignore case, multiline, or dot-all.
- Paste sample text and select Test Regex.
- Review highlighted matches, zero-based character positions and capture groups.
- Enter replacement text to preview the transformed result.
Note: This tool uses JavaScript regular-expression syntax. It checks text patterns; it does not guarantee that matched data (such as an email address) is valid in the real world. Avoid untrusted, extremely complex patterns that may run slowly.