Testing JavaScript regular expressions
This tool runs your pattern against the test string using the browser's native RegExp engine — the exact same engine your JavaScript code will use at runtime, so what you see here is exactly what you'll get in production. Already know what you want to match but not the syntax for it? The Regex Builder lets you click together a pattern instead of writing it from scratch.
Common flags
g— find all matches instead of stopping at the first one (enabled automatically here so you always see every match).i— case-insensitive matching.m—^and$match the start/end of each line, not just the whole string.s— lets.match newline characters too.u— treats the pattern as a sequence of Unicode code points.
FAQ
Do you have ready-made patterns for common things like email, UUIDs, phone numbers, domains, or URLs?
See Regex for Email, Regex for UUID, Regex for Phone Number, Regex for Domains, and Regex for URLs for practical patterns, what each part matches, and their known limitations — paste any of them here to test against your own strings.
Why do numbered groups show as $1, $2...?
That's the standard reference syntax for capture groups in JavaScript replacement strings — group 1 is the first (...) in your pattern, in order.
The pattern doesn't match what I expect — how do I see why?
Paste it into the Regex Visualizer to see the pattern broken down into groups, alternatives, and quantifiers — it's often faster to spot a misplaced quantifier or an unintended group boundary in a diagram than in the raw string.
Where can I look up what a token means?
The Regex Cheat Sheet Generator is a customizable syntax reference you can filter and export as Markdown or plain text.
My pattern seems to hang instead of failing — what's going on?
That's a sign of catastrophic backtracking. The Regex Debugger steps through a single match attempt one piece at a time and flags the nested-quantifier shapes that cause it.