Regex Tester

Popular

Live match highlighting & groups

//g

Hover a flag to see what it does.

3 matches· 0.14 ms

Highlighted matches

/ 3
The quick brown fox jumps over the lazy dog. The dog was not amused.

Matches 3

Match 1index 49quick
Match 2index 1015brown
Match 3index 2025jumps

Explanation

AI explanations coming soon
\bWord boundary
\wAny word character (a–z, A–Z, 0–9, _)
{5}Repeat exactly 5 times
\bWord boundary

Regex cheat sheet

Character classes

.
Any character except newline
\d
Any digit (0–9)
\D
Any non-digit
\w
Word character (a–z, A–Z, 0–9, _)
\W
Any non-word character
\s
Any whitespace
\S
Any non-whitespace
[abc]
Any one of a, b, or c
[^abc]
Anything except a, b, or c
[a-z]
Any character in the range

Anchors & boundaries

^
Start of string (or line with m)
$
End of string (or line with m)
\b
Word boundary
\B
Not a word boundary

Quantifiers

*
Zero or more
+
One or more
?
Zero or one (optional)
{n}
Exactly n times
{n,}
n or more times
{n,m}
Between n and m times
*?
Lazy — as few as possible

Groups & alternation

(…)
Capturing group
(?:…)
Non-capturing group
(?<name>…)
Named capturing group
\1
Backreference to group 1
|
Alternation — match either side

Lookaround

(?=…)
Lookahead — followed by
(?!…)
Negative lookahead
(?<=…)
Lookbehind — preceded by
(?<!…)
Negative lookbehind

Escapes

\.
A literal dot
\n
Newline
\t
Tab
\uFFFF
Unicode code point

Examples

Match every 5-letter word

Input
/\b\w{5}\b/g  ·  "The quick brown fox jumps"
Output
quick, brown, jumps

Capture a date with named groups

Input
/(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})/  ·  "2026-07-14"
Output
year: 2026 · month: 07 · day: 14

Frequently asked questions

Does my pattern or test text leave my browser?

No. The tool uses your browser's own JavaScript regex engine, so matching runs entirely on your machine — nothing is uploaded to any server.

Which regex flavour does it use?

It matches with the native JavaScript (ECMAScript) engine — the same one your browser and Node.js use. Flags g, i, m, s, u and y are all supported, including named capture groups and lookbehind.

What do the flags do?

g finds every match (not just the first), i makes matching case-insensitive, m lets ^ and $ match at line breaks, s lets . match newlines, u enables full Unicode handling, and y (sticky) matches only from the last position.

How do I read capture and named groups?

Each match lists its numbered capture groups (Group 1, Group 2…) in order, plus any named groups like (?<year>…). Empty and unmatched optional groups are shown explicitly so you can tell them apart.

Related tools