Regex Tester
Test regular expressions with live match highlighting. JavaScript engine.
Frequently asked questions
This tool uses the JavaScript regex engine (ECMAScript), not PCRE or RE2. Patterns from Python, PHP, Ruby, or Go may behave differently here — especially features like possessive quantifiers, atomic groups, or lookbehind with variable length.
g (global) finds all matches rather than stopping at the first. i (case-insensitive) makes [a-z] match A–Z too. m (multiline) makes ^ and $ match line boundaries instead of just string boundaries. s (dotall) makes . match newlines. u enables full Unicode support. y (sticky) anchors the match to the current lastIndex position.
A common issue is that zero-length matches can cause an infinite loop. This tool automatically advances lastIndex past zero-length matches to prevent that.
You can name a group with (?<name>...). For example, (?<year>\d{4})-(?<month>\d{2}) gives you groups named year and month, which appear in the capture groups panel below.
Yes. Your pattern, flags, and test string are encoded in the URL hash. Copy the URL from the address bar and send it — the recipient will see the same pattern and test string loaded.