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: ravi@example.com, PAN ABCDE1234F, PIN 500081.
| # | Match | Index | Groups |
|---|---|---|---|
| 1 | 9123456789 | 32 | – |
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, ca* a+ a? 0+, 1+, 0 or 1a{3,5} 3 to 5 times(…) capture group(?<name>…) named groupa|b a or bHow to use Regex Tester
- Type your pattern and choose flags.
- Paste test text. Matches are highlighted as you type.
- 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 →- Find and Replace Replace every occurrence of a word or pattern in a block of text, with optional regular expressions for advanced edits.
- JSONPath Tester Write and debug JSONPath queries used in API tests, Postman, Kubernetes and data pipelines.
- Cron Expression Explainer Understand what a crontab schedule means and when it will next run.
- Markdown Previewer A simple Markdown editor for READMEs, notes and documentation, with an instant preview.
- Unix Timestamp Converter Convert epoch time from logs, databases and APIs into human-readable dates, and the other way round.
- Color Converter Translate a colour between web, design and print formats, and get lighter and darker variations.