Regex Tester
Test regular expressions live with highlighted matches, groups, replace and code snippets.
About Regex Tester
How to use it
- Type a pattern between the slashes and choose flags: g (all matches), i (ignore case), m (multiline), s (dot matches line breaks) and u (Unicode).
- Paste text into Test text. Matches are highlighted as you type.
- The Matches tab lists every match with its position and capture groups, including named groups.
- The Replace tab previews a replacement, using $1 or $<name> to insert groups.
- The Code tab gives the pattern ready to paste into JavaScript, PHP or Python.
Ready-made patterns
Load tested patterns for email addresses, URLs, Indian mobile numbers, PIN codes, PAN, GSTIN, IFSC codes, IPv4 addresses, dates, hex colours, strong passwords, URL slugs and HTML tags, then adapt them.
Safe to experiment
Patterns run in the background with a time limit. A pattern that would hang the page, such as (a+)+ on a long string, is stopped and explained instead.
Frequently asked questions
Which regex flavour is this? JavaScript (ECMAScript), which most other languages closely follow. The Code tab notes the main differences, such as Python's named group syntax.
This tool runs in your browser. Nothing you enter is sent to Innovalogic.