Regex Tester

Test a regular expression and inspect its matches and groups

Expression
/ /g
Cheat sheet
.
Any character except a line break (any at all with the s flag)
\d \w \s
Digit, word character [A-Za-z0-9_], whitespace; \D \W \S negate them
[abc] [^abc] [a-z]
One of, none of, a range
^ $ \b
Start, end (of a line with the m flag), word boundary
* + ? {2,5}
0 or more, 1 or more, optional, between 2 and 5; add ? to match as few as possible
(…) (?<name>…) (?:…)
Capturing group, named group, non-capturing group
a|b
a or b
(?=…) (?!…) (?<=…) (?<!…)
Followed by, not followed by, preceded by, not preceded by
\1 \k<name>
The text matched by group 1, by a named group
\p{L}
A Unicode letter, with the u flag (also \p{N}, \p{Emoji}…)