Regex Tester
Test and debug regular expressions in real time.
Click a token to insert it into the pattern.
How It Works
Regular expressions (regex) are patterns used to find, match, and extract text. This tester
uses the browser's built-in JavaScript regex engine — the same one used in String.prototype.match(), replace(), and matchAll().
Flags change how matching works: g finds all matches (without it, only the first is returned); i ignores case; m makes ^ and $ match line boundaries instead of the whole string; s (dotAll) makes . match newlines; u enables full Unicode support.
Capture groups let you extract parts of a match. Use () for
numbered groups and (?<name>) for named groups. Non-capturing groups (?:) group without capturing, which is faster when you don't need the captured value.
Greedy vs. lazy: quantifiers like * and + are greedy by default — they
match as much as possible. Adding ? makes them lazy: .*? matches as
little as possible. Be careful with patterns like (a+)+ on long strings —
catastrophic backtracking can cause the browser to hang.