Regex Tester

Build and debug regular expressions against sample text, with every match and capture group listed.

Runs in your browser. Nothing is uploaded Free, no sign-up Works on mobile
Regular expression
//gu
Presets:
Test text
1 match
Call Ravi on +91 98765 43210 or 9123456789. Office: 040-23456789. Email: [email protected], PAN ABCDE1234F, PIN 500081.
#MatchIndexGroups
1912345678932–
Replace with (optional)Use $1, $2 or $<name> for groups
Cheat sheet
\d digit
\w letter, digit or _
\s whitespace
. any character
^ $ start / end
[abc] one of a, b, c
[^abc] not a, b, c
a* a+ a? 0+, 1+, 0 or 1
a{3,5} 3 to 5 times
(…) capture group
(?<name>…) named group
a|b a or b

How to use Regex Tester

  1. Type your pattern and choose flags.
  2. Paste test text. Matches are highlighted as you type.
  3. Check capture groups and try a replacement.

Frequently asked questions

Which regex flavour is used?

JavaScript (ECMAScript) regular expressions, as used in browsers and Node.js, including named groups and lookbehind.

What does the g flag do?

Global: find all matches instead of stopping at the first one.

Related tools

All Developer Tools →