Back to tools
Dev Utilspublic tool

Regex Tester

Test a regular expression, see every match highlighted in your own text, inspect each capture group, and preview a live find-and-replace. Nothing leaves this tab.

Status
Matching
Matches
2
Capture groups
2
Scanned
40 chars

1 · Pattern

The expression itself, typed without slashes

Flags — how should the pattern behave?

Effective expression /(?<label>[A-Za-z]+)=(\d{2,4})/g

Common patterns

Click one to load its pattern and a matching sample text.

2 · Test text

40 characters

2 matches

Matches, highlighted in place

2 capture groups

width=1024 height=768 scale=2 depth=full
whole matchcapture groupempty match

3 · Matches

2 matches

  • #1index 0end 10

    width=1024

    • $1 width
    • $2 1024
    • $<label> width
  • #2index 11end 21

    height=768

    • $1 height
    • $2 768
    • $<label> height

4 · Capture groups

What each group captured — click a value to copy it

GroupCapturedTook part in
$0whole match2 / 2
$1<label>2 / 2 matches
$2(unnamed)2 / 2 matches

Pattern breakdown

9 elements in source order

  • (?<label>groupnamed capture group · capture group 1
  • [A-Za-z]charClasscharacter class
  • +quantifierrepeats the previous element (+)
  • )groupclose group
  • =literalliteral character
  • (groupcapturing group · capture group 2
  • \descapeany digit 0-9
  • {2,4}quantifierrepeats the previous element ({2,4})
  • )groupclose group

Replace preview

$& whole match · $1..$9 by number · $<name> by name · $$ a literal dollar — applied to every match

width = 1024
height = 768
scale=2
depth=full