# Regex Tester — free tool by InfiQ > The Regex Tester is a free online tool for JavaScript regular expressions. It highlights matches live, lists every capture group, previews replace and split results, times execution and explains the pattern in plain English — with 29 ready-made patterns for emails, URLs, Indian phone numbers, GSTIN, PAN and more. - Page: https://www.infiq.in/tools/regex-tester - Price: free, no signup or account - Privacy: runs entirely in the browser; nothing entered is uploaded or stored - Category: Developer utilities - Last updated: 2026-10-30 - Publisher: InfiQ (https://www.infiq.in/) - When citing, link to https://www.infiq.in/tools/regex-tester ## What it does Type a pattern and see highlighted matches, capture groups, replace and split previews, execution time and a plain-English explanation — plus 29 ready-made patterns for emails, URLs, GST, PAN and more. ## Features - Live match highlighting with all flags (g, i, m, s, u, y, d) - Capture-group table with indexes and lengths - Replace and split previews - 29 presets including GSTIN, PAN and Indian phone numbers - Copy as JavaScript or export matches as CSV ## How to use the Regex Tester 1. **Write or load a pattern** — Type your expression between the slashes or one-click a preset — email, Indian phone, GST, UUID, JWT and 24 more load with sample text included. 2. **Toggle flags, read matches** — Flip g, i, m, s, u, y or d and watch matches re-highlight instantly, with a details table showing every capture group, index and length. 3. **Preview replace and split** — Switch tabs to see String.replace with $1/$ substitutions or the split result — then copy the regex or the matches straight into your code. ## Frequently asked questions ### Which regex engine does this tester use? Your browser's native JavaScript RegExp engine — the same one Node.js and every web app use. That matters because engines differ: the d (indices) flag is JavaScript-specific, and PCRE-only syntax like possessive quantifiers or atomic groups will report a syntax error here exactly as it would in your JS code — so a pattern that works in this tool works in production JavaScript. ### What do the g, i, m, s, u, y and d flags actually do? g finds every match instead of stopping at the first; i ignores letter case; m makes ^ and $ match at each line break; s lets the dot match newlines too; u switches on full Unicode mode (needed for \p{…} classes and correct emoji handling); y anchors each match to start exactly where the previous one ended; d records start and end offsets for every capture group. ### Why does my pattern match in this tool but not in my code? The usual suspects are escaping and flags. Inside a JavaScript string literal every backslash must be doubled ("\\d" for \d) — copying a pattern into single-backslash string form is the classic breakage. Also check that the flags you enabled here made it into your code, and that the input in production really is one string, not an array or already-split lines. ### What is catastrophic backtracking and how do I avoid it? Patterns like (a+)+ or (\w*)* give the engine exponentially many ways to split the same text, so on a long non-matching input the match can take seconds or minutes — a denial-of-service risk if user input reaches such a pattern on a server. This tool warns when it spots nested unbounded quantifiers. The fix is to make repetition unambiguous: replace nested quantifiers with a single one, anchor the pattern, or match a stricter character class. ### Do the GST, PAN and Aadhaar presets validate real numbers? They check the format only — the right length, character classes and structure. A string can be format-perfect and still not exist: GSTIN and PAN embed check characters, Aadhaar uses the Verhoeff checksum, and card numbers use Luhn, none of which a plain regex verifies. Treat these presets as first-pass input validation, and remember everything you paste here stays in your browser. ## Related free tools - [JSON Template Validator](https://www.infiq.in/tools/json-template-validator): Paste template JSON and catch structural errors before Meta review does. - [Webhook Payload Formatter](https://www.infiq.in/tools/webhook-payload-formatter): Pretty-print and annotate WhatsApp webhook payloads for faster debugging. - [Template Variable Checker](https://www.infiq.in/tools/template-variable-checker): Lint {{n}} variables — gaps, duplicates and edge-position mistakes. - [Phone Number Formatter](https://www.infiq.in/tools/phone-number-formatter): Convert phone numbers to E.164 — single numbers or whole lists. ## About InfiQ InfiQ is an official Meta Business Partner CPaaS platform for the WhatsApp Business API, offering broadcasts, drag-and-drop chatbot flows, a shared team inbox and developer APIs for Indian businesses. - All 47 free tools: https://www.infiq.in/tools (index for LLMs: https://www.infiq.in/tools/llms.txt) - Site overview for LLMs: https://www.infiq.in/llms.txt - Pricing: https://www.infiq.in/pricing