Regex Tester

Type a pattern and some text to test it against. Matches are highlighted live as you type.

? New to regex? Open this quick guide

The idea in one sentence

A regex (regular expression) is a small pattern that describes what you're looking for in text — so instead of one exact word, you search for a shape, like "a £ sign followed by digits and a decimal." Whatever matches gets highlighted. Type the pattern in the box (no slashes needed); matches light up as you type.

The building blocks (the whole alphabet is small)

You typeMeansExample match
catthose exact letterscat in "category"
\dany digit (0–9)7
\wany letter, digit or _a, 5
.any single characteranything
\sa space or tab" "
+one or more of the thing before it\d+ → 1399
*zero or more
?optional (zero or one)
{2}exactly that many\d{2} → 05
[abc]any one of these charactersa, b or c
[A-Z]any capital letter
|orcat|dog
^$start … end of a line

The trick to reading a pattern: go left to right and say it out loud. \d{2}/\d{2}/\d{4} = "two digits, a slash, two digits, a slash, four digits" = a date like 05/01/2026.

Ready-made examples (click one to load it into the Pattern box)

PatternFinds
\d+\.\d{2}any amount with pennies — 1399.56, 27.80
£[\d,]+\.\d{2}£ amounts — £1,399.56
\d{4}-\d{2}-\d{2}dates like 2026-01-05
\d{2}/\d{2}/\d{4}dates like 05/01/2026
\d{2}-\d{2}-\d{2}sort codes — 12-34-56
INV-\d+invoice refs — INV-2043
[\w.]+@[\w.]+email addresses

The checkboxes

global (g) — on: highlight every match, not just the first. Leave it on.
ignore case (i) — on: treat VAT and vat the same.
multiline (m) — only matters when you use ^/$ and want them per line.

Try it now

then click any example pattern above and watch it highlight.

Enter the pattern only, without slashes. Set flags below.