Regex tester
Writing a regular expression by trial and error is much faster when you can see the results live. Type a pattern and flags, paste your text, and this regex tester highlights every match, lists its position and capture groups (including named groups), and previews afind-and-replace. It uses the JavaScript engine, and includes ready-made patterns forIndian mobile numbers, PIN codes, PAN, GSTIN, IFSC and UPI IDs to start from.
How to use it
- Type a pattern (without the surrounding slashes) and flags, or pick a sample.
- Paste the text to test — matches highlight as you type.
- Check the groups table, or open Replace to preview substitutions.
Example
With the pattern [6-9]\d9 and the g flag, the sample text matches 9876543210 and 8123456789 — but not 5123456789, because Indian mobiles start with 6–9. Add \b at both ends to avoid matching inside longer numbers. For simple find-and-replace without regex, use find and replace.