Regex Tester
Write a JavaScript regular expression, pick flags, and see every match, offset, and capture group. The pattern never leaves this tab.
Tool input stays in your browserDid you know · History
The halting problem is undecidable: no program can determine whether every program eventually stops.
Text
you edit—JavaScript regex, not PCRE
The engine is new RegExp in this browser — the same dialect as Node and the language you ship to the client. Lookbehind, named groups, and Unicode property escapes (with the u flag) work when the browser supports them. PCRE-only syntax such as (?(condition)yes|no) does not. If you are debugging a Python or PHP pattern, treat this as a close cousin, not a guarantee.
Flags
- g — find every match, not just the first.
- i — case-insensitive.
- m —
^and$match line edges, not only the whole string. - s —
.matches newlines. - u — Unicode code points and property escapes.
- y — sticky: match only at
lastIndex, starting at 0 here.
Without g or y, only the first match is reported. Zero-width matches (for example \b) advance one character so the loop cannot spin. The table caps at 5,000 rows.
Why it is private
Matching runs as JavaScript inside this page. Open DevTools, switch to the Network tab, and paste a log with emails or tokens: no request carries that text. A pathological pattern can still hang this tab (catastrophic backtracking); it cannot send the haystack anywhere else.
Regex tester FAQ
JavaScript regex tester, flags, capture groups, PCRE vs JS, and testing a regular expression online.
What is a regex tester?
A regex tester lets you write a regular expression, choose flags, and see matches against sample text. This regex tester uses JavaScript’s RegExp — the same dialect as the browser and Node — and lists index, match text, and capture groups, including named groups.
How do I test a regular expression online?
Enter the pattern between the slashes, toggle flags (g, i, m, s, u, y), and paste the haystack. Matches appear in a table. Copy JSON dumps the match list. The pattern and text never leave this tab.
Is this PCRE or JavaScript regex?
JavaScript only. Lookbehind and Unicode property escapes work when the browser supports them (u flag for properties). PCRE-only syntax such as conditional patterns will not. Debug Python or PHP patterns here only as an approximation.
What do regex flags g, i, m, s mean?
g is global (every match). i is case-insensitive. m makes ^ and $ match line edges. s (dotAll) lets . match newlines. u is Unicode. y is sticky. Without g or y, only the first match is reported.
Can a regex hang my browser?
A pathological pattern can stall this tab (catastrophic backtracking). It cannot send your haystack elsewhere. Match count is capped at 5,000. Prefer testing on a short sample first.