Regex Tester
Live matches, capture groups, flags and replace preview.
Runs in your browser
0 chars
Highlighted
Output will sizzle here.
Quick reference
- .
- any character (except line breaks)
- \d \w \s
- digit, word character, whitespace
- \D \W \S
- not a digit / word char / whitespace
- [abc] [^abc]
- one of a, b, c / anything else
- ^ $
- start / end of input (or line with m)
- \b
- word boundary
- * + ?
- 0 or more, 1 or more, 0 or 1
- {2,5}
- between 2 and 5 times
- *? +?
- lazy (as few as possible)
- (…) (?<name>…)
- capture group, named group
- (?:…)
- group without capturing
- (?=…) (?!…)
- lookahead, negative lookahead
- a|b
- a or b
- $1 $<name>
- use a group in the replacement