Regex Tester
Test JavaScript regular expressions with live match and capture group highlighting.
Test your regex live
Regular expressions are powerful for email validation, log parsing, text cleanup and data extraction, but hard to write. The Regex Tester highlights every match and capture group in your test text as you type the pattern.
Features
- g, i, m, s, u and y flags
- The position of every match and its capture groups (numbered and named)
- Clear error messages for invalid patterns
Freeze protection
Some badly written patterns (catastrophic backtracking) can lock up a browser. Here, matching runs in a background worker with a time limit, so excessively slow patterns are stopped safely. Your test text is never sent anywhere.
How to use Regex Tester
- Write your regex pattern.
- Choose the flags you need.
- Paste test text; matches are highlighted live.
- Inspect the capture groups and refine the pattern.
Why use this tool?
Speeds up trial and error and makes sure the pattern works before it goes into your code.
FAQ
Can a bad pattern freeze the page?
No. Matching runs in a background worker with a time limit; overly slow patterns are stopped safely.
Which regex flavour is used?
JavaScript (ECMAScript) regular expressions. Most syntax is shared with PCRE, Python and .NET, but there are some differences.
How do I match accented letters?
Turn on the u flag and use Unicode property classes such as \p{L}, or write character sets like [éèêë].
Related tools
Find and Replace
Find and replace text with case sensitivity and regular expression support.
Open toolJavaScript Minifier
Safely strip comments and indentation from JavaScript for smaller files.
Open toolHTTP Status Codes
Search every HTTP status code by number, name and meaning: 200, 301, 404, 500 and more.
Open toolJSON Formatter and Validator
Pretty-print messy or minified JSON and find errors with line and column details.
Open tool