Test JavaScript regular expressions live with match highlighting and capture groups.
| \d \w \s | Digit, word char, whitespace |
| \D \W \S | Negations |
| [abc] [^abc] | Char class / negated class |
| [a-z] | Range |
| . * + ? | Any, 0+, 1+, 0 or 1 |
| {n} {n,} {n,m} | Quantifiers |
| .*? | Lazy quantifier |
| ^ $ | Start / end of string (or line w/ m) |
| \b \B | Word boundary / non-boundary |
| (abc) | Capture group |
| (?:abc) | Non-capturing group |
| (?<name>abc) | Named group |
| a|b | Alternation |
| (?=abc) (?!abc) | Lookahead / negative |
| flags: g i m s u y | global, case-insensitive, multiline, dotall, unicode, sticky |
Type a regular expression pattern in the Pattern field and any flags (g, i, m, s, u, y) in the flags input. Type or paste a test string below. Matches are highlighted in the test string and listed in the Matches table along with capture groups and indices. Invalid patterns show an error message.