Regex Tester

Write a regular expression, watch every match light up, and finally understand what each token does.

๐Ÿ‘ค Your account

๐Ÿงช Regex tester

Type a pattern and watch every match light up in your test text โ€” with indexes, capture groups and a plain-language explanation of what the pattern actually does.

/ /

Highlighted text

Matches

๐Ÿ” What your pattern means

Start typing a pattern and its pieces will be explained here.

Try one

Tip: paste your own text first, then try a pattern against it.

Pattern working? โ€” it keeps the pattern, flags and test text so you can reuse it any time.

๐Ÿ“– Cheat sheet โ€” the tokens that matter

TokenMeansExample
\dAny digit 0โ€“9\d{4} โ†’ 2026
\wLetter, digit or underscore\w+ โ†’ hello_42
\sWhitespacea\sb โ†’ "a b"
.Any character except newlineh.t โ†’ hat, hot
[abc]One of a, b or c[aeiou] โ†’ any vowel
[^abc]Anything EXCEPT a, b or c[^0-9] โ†’ not a digit
+One or morego+gle โ†’ google
*Zero or moreab*c โ†’ ac, abc, abbc
?Optional (zero or one)colou?r โ†’ color, colour
{n,m}Between n and m times\d{2,4} โ†’ 42, 2026
^ / $Start / end anchors^\d+$ โ†’ digits only, whole string
( )Capture group (saved as $1, $2โ€ฆ)(\d+)-(\d+) โ†’ year-month
|ORcat|dog โ†’ either word
\bWord boundary\bcat\b โ†’ the word cat only

Uppercase flips the meaning: \D = not a digit, \W = not a word character, \S = not whitespace. Add ? after a quantifier (+?, *?) to make it lazy โ€” match as little as possible instead of as much as possible.

๐Ÿ“š My Pattern Library

Patterns you have fought for and won โ€” keep them here with their flags, test text and your own notes. Records are saved under your local account (or guest space) on this device โ€” create, view, edit and delete them any time.

More free tools by Dinal Studios