Regex Tester
Test regular expressions against text with live match highlighting
Test and debug regular expressions against any text with live match highlighting. Supports JavaScript-flavour regex with all standard flags.
Regex flags
| Flag | Name | Effect |
|---|---|---|
| g | Global | Find all matches, not just the first |
| i | Case-insensitive | "a" matches "a" and "A" |
| m | Multiline | ^ and $ match start/end of each line, not whole string |
| s | Dotall | . matches newline characters |
| u | Unicode | Correctly handles unicode characters and code points |
| y | Sticky | Match starting at lastIndex only |
Common patterns cheat-sheet
- \d
- Any digit (0–9)
- \w
- Word character (letter, digit, underscore)
- \s
- Whitespace (space, tab, newline)
- .
- Any character except newline (unless s flag)
- [abc]
- Any of a, b, or c
- *
- Zero or more of the previous
- +
- One or more of the previous
- ?
- Zero or one (optional)
- {n,m}
- Between n and m repetitions
- (abc)
- Capture group
- ^ / $
- Start / end of line (or string)
Frequently asked questions
Which regex flavour does this use?
JavaScript regex (the same flavour Node.js and browsers use). Most patterns also work in other languages with small adjustments.
What flags are supported?
g, i, m, s, u, and y — the standard JavaScript flags.
Does it support lookahead/lookbehind?
Yes, including positive and negative variants: (?=...), (?!...), (?<=...), (?<!...).
Is there a text size limit?
No enforced limit. Very large inputs (>1 MB) may slow the browser.