Regex Tester
Test a regular expression against sample text, with matches highlighted live, capture groups shown, and clear errors for invalid patterns.
2 matches
Everything you enter is processed in your browser and isn't sent to our servers.
How to use regex tester
- 1Enter a regular expression pattern.
- 2Toggle flags: global, case-insensitive, multiline, dot-matches-newline.
- 3Paste or type the text you want to test against.
- 4Matches highlight live, with capture groups listed below.
About this tool
This tool uses your browser's native JavaScript RegExp engine — the exact same engine that runs your regex in production if you're testing a pattern for JavaScript code, so what you see here is what you'll get.
Matches are found using the global flag internally (added automatically if you don't set it) so every occurrence is shown, not just the first. Numbered capture groups and named groups (using the `(?<name>...)` syntax) are both displayed for every match.
An invalid pattern — like an unmatched parenthesis or bracket — shows the JavaScript engine's own error message instead of silently failing, so you can see exactly what's wrong.
Frequently asked questions
Yes — this uses your browser's built-in RegExp, the same engine JavaScript code runs. Other languages (Python, PCRE, .NET, etc.) have their own regex engines with some syntax differences, so a pattern tested here is guaranteed to match JavaScript behavior specifically, not necessarily every other language's regex flavor.
Related tools
JSON Formatter
Format, minify and validate JSON instantly.
JS Formatter
Format and beautify messy JavaScript code.
Diff Checker
Compare two texts and see line-by-line differences.
Cron Expression Generator
Build a cron expression with a plain-English explanation.
URL Encode / Decode
Percent-encode text for URLs, or decode it back.