Regex Tester

JavaScript flavour, evaluated live as you type. Matches are highlighted in the sample, and every capture group is listed underneath.

Pattern
/ /
Sample text

Use $1, $<name>, $& as usual.

Highlighted
Enter a pattern and some sample text.
Matches
Nothing yet.
Quick reference
. any character except newline
\d \w \s digit, word character, whitespace
\D \W \S the opposite of each
[abc] any one of a, b or c
[^abc] anything except those
a|b a or b
* zero or more
+ one or more
? zero or one
{2,5} between two and five
*? lazy, take as few as possible
(abc) capture group
(?:abc) group without capturing
(?<year>\d{4}) named group
^ $ start and end
\b word boundary
(?=abc) followed by
(?!abc) not followed by