Live JavaScript regex testing with match highlighting and capture-group breakdown. Type a pattern, watch matches glow in your test text in real time.
| . | any char except newline (or any char with s flag) |
| \d \D | digit / non-digit |
| \w \W | word char / non-word |
| \s \S | whitespace / non-whitespace |
| ^ $ | line start / end (with m flag) β else string start/end |
| \b \B | word boundary / non-boundary |
| x* x+ x? | 0+, 1+, 0 or 1 |
| x{n} x{n,m} | exactly n, between n and m |
| x*? x+? | non-greedy |
| [abc] [^abc] | char class / negated |
| [a-z] | range |
| (abc) | capture group |
| (?:abc) | non-capturing group |
| (?<name>abc) | named group |
| (?=abc) (?!abc) | lookahead / negative |
| (?<=abc) (?<!abc) | lookbehind / negative |
| a|b | alternation |
| \1 \2 | backreference |