Regex Tester
Write a pattern, paste sample text, and see what matches. Testing stays in the browser, so logs and sample records are not uploaded.
Runs entirely in your browser. Nothing you paste or upload is sent to a server.
Match list
- No matches
What is Regex Tester?
A regex tester compiles your pattern with the browser’s JavaScript RegExp engine and highlights each match in the sample text. Capture groups are listed with the match. Flags you type, such as i or m, are passed through. A global search is always used so every match can be shown.
An invalid pattern shows the engine error and does not pretend there were zero matches. JavaScript regex is not identical to PCRE or Python, so confirm the same pattern in the language you will ship.
How to use it
- Enter a regular expression.
- Paste the text you want to test.
- Check the highlighted matches and groups.
Useful for
- Try a capture group
- See why a pattern misses
- Test a pattern before adding it to code
Related tools
Cron Expression Generator
Free cron generator online — build cron expressions and read them as plain English.
SQL Formatter
Beautify messy SQL queries with consistent indentation and keyword casing.
JSON Formatter & Validator
Beautify, minify, validate, and explore JSON with instant error highlighting — 100% in your browser.
Questions about Regex Tester & Explainer
Which regex engine is used? +
Your browser’s native JavaScript RegExp engine, including common flags like g, i, m, s, and u.
How do I test a regular expression? +
Type the pattern, set flags such as i or m, and paste sample text. Matches are highlighted. Capture groups are listed under each match.
Why does my pattern show an error? +
The pattern is not valid JavaScript regex. An unclosed group or a bad escape is reported by the browser engine. Fix the pattern and test again.
Will this match the same way in PHP or Python? +
Not always. This page uses JavaScript RegExp. Confirm the pattern in the language you ship before you rely on it.