Regex Tester
Write a regular expression and see every match highlighted live, with capture groups and a replace preview.
Loading tool…
Need help with this tool or found a problem? WhatsApp support Email
What does the Regex Tester do?
Type a pattern and flags, paste test text, and matches are highlighted instantly. The table lists each match with its position, numbered groups ($1, $2…) and named groups. Add a replacement string to preview String.replace results.
The tester uses your browser’s JavaScript regex engine, so results match what your JavaScript code will do. It stops after 500 ms to protect you from patterns with catastrophic backtracking.
How to use the Regex Tester
- Enter the regex without slashes, and flags such as g, i or m.
- Paste your test text.
- Inspect highlighted matches and the groups table.
- Optionally enter a replacement to preview.
Examples
Emails
Pattern (\w+)@(\w+)\.com on “[email protected]” captures “ali” and “example”.
Reformat dates
Pattern (\d{2})/(\d{2})/(\d{4}) with replacement $3-$2-$1.
Common use cases
- Building validation patterns
- Writing search-and-replace rules
- Learning regular expressions
- Debugging log parsing
Features and benefits
- Private by design — your data is processed on your device and never uploaded.
- Free with no account, no watermark and no usage limits.
- Works on phones, tablets and desktops in any modern browser.
Limitations to know
- JavaScript regex differs from PCRE, Python and .NET in some features.
Frequently asked questions
Which flags are supported?
g, i, m, s, u, y and d.
Why does my pattern freeze other sites?
Nested quantifiers like (a+)+ can backtrack exponentially. This tester stops after 500 ms.
Do I include the slashes?
No, enter only the pattern.
Related tools
All developer toolsFind and Replace Text
Find and replace words or patterns, with case and regex options.
Text ToolsJSON Validator
Validate JSON and pinpoint the line and column of errors.
Cron Expression Helper
Explain cron expressions in plain English and list next run times.
Text Diff Checker
Compare two texts and highlight added and removed lines or words.
Text ToolsMarkdown Previewer
Write Markdown and see a live, sanitised HTML preview.
JSON Formatter
Beautify JSON with indentation and syntax error locations.