Regex Tester
Write a regular expression, toggle the flags, and see every match highlighted in your test string as you type. Capture groups are listed per match and a replacement preview runs alongside, so you can confirm both what the pattern finds and what it would produce. The engine is the browser's own JavaScript RegExp, which means what you see here is exactly what your code will do — including the places JavaScript differs from PCRE, Python or Go. Nothing is sent anywhere: patterns and test data stay in the page, which matters when the sample you are debugging is real data.
- #1 @14jane@example.com
- #2 @34john@test.io
Contact me at [redacted] or [redacted] for details.
How to use
- Enter a regex pattern (without delimiters).
- Toggle flags: g (global), i (case-insensitive), m (multiline), s (dotall), u (unicode).
- Type or paste a test string — matches highlight as you type.
- Provide a replacement string to preview the result.
Frequently asked questions
- What dialect does this use?
- JavaScript regex (ECMAScript). Lookbehinds, named groups, and Unicode property escapes are supported in modern browsers.
- How do I reference capture groups in the replacement?
- Use $1, $2, $& for the full match, or $<name> for named groups.
- Is there a match limit?
- The first 10,000 iterations are captured to keep the UI responsive; the first 50 are shown in the match list.
- Is my data sent anywhere?
- No. Patterns and test strings run only in your browser, and the auto-save keeps them in your local storage.
- Why does my pattern freeze the page?
- Almost certainly catastrophic backtracking. Patterns that nest quantifiers - something like (a+)+b - can force the engine through an exponential number of ways to split the input before admitting there is no match. The fix is to make the inner parts unambiguous, usually by replacing a greedy .* with a negated character class that cannot overlap the delimiter.
- What does the global flag actually change?
- Without g, matching stops at the first result. With g, the search continues through the string, which is what makes the match list longer than one - and it also makes the regular expression stateful in real code, because it remembers where it stopped. That is the usual reason a pattern reused in a loop appears to skip every other match.
- How do I match across multiple lines?
- Two different flags are involved and they are easy to confuse. Multiline changes what the anchors mean, so ^ and $ match at every line break instead of only at the ends of the string. Dot-all changes what the dot matches, letting it cover newlines too. If a pattern stops at the end of the first line, dot-all is usually the one you wanted.
Guides on this topic
Related tools
Glob Pattern Tester
Test file paths against a glob pattern (*, **, ?, [...], {a,b}) in your browser.
Find & Replace
Find and replace across a block of text. Optional regex with global, case-insensitive, multiline, and dotAll flags. Live match count.
String Escape Converter
Escape a string for 10 contexts at once — JavaScript, JSON, HTML entities, URL, SQL, regex, Bash (single/double quote), C string, Unicode \u escapes. Copy whichever you need.
Math Expression Evaluator
Evaluate arithmetic expressions with the usual math functions — `sqrt`, `sin`, `log`, `pow`, `min/max`, and constants `pi`, `e`, `tau`.
CSS Selector Tester
Test a CSS selector against your HTML and see exactly which elements it matches, in your browser.
Cron Expression Explainer
Translate a cron expression into plain English (or your language) and break down each field.