Regex Tester

Test JavaScript/Python-style regular expressions live.

No upload

Loading tool…

Processing happens on your device using your browser's CPU/GPU. Results are kept only in this tab's memory and are wiped when you click “Clear” or close the page.

About Regex Tester

Write a regular expression and watch it match your sample text live, with every match highlighted and listed with its position and capture groups. Preset patterns for email addresses, Indian mobile numbers, PAN, GSTIN, PIN codes, URLs, dates and IPv4 are one click away. Useful for developers, data cleaners and students learning regex. Everything runs in your browser, so test data stays on your device.

How to use Regex Tester

  1. Click a preset chip such as Email, PAN, GSTIN or Indian mobile, or type your own pattern.
  2. Set the flags, for example gi for a global case-insensitive search.
  3. Paste your sample text into the Test text box and watch matches highlight as you type.
  4. Check the match count and the table of index, match and capture groups below.
  5. Enter a replacement, using $1 for the first group, to preview a find and replace.

What people use it for

  • Validating PAN, GSTIN or PIN code formats before an import into an accounting system
  • Pulling every phone number or email out of a pasted block of text
  • Testing a log-parsing pattern before putting it into a script or a grep command
  • Learning what capture groups do by seeing each group filled in the match table

Good to know

The syntax is JavaScript's, which covers the same ground as Python's re module for common patterns, though named groups, lookbehind and Unicode property escapes differ and depend on your browser. The global flag is added automatically for highlighting. The match table shows the first 200 matches. A catastrophically backtracking pattern can freeze the tab.

Frequently asked questions

Does it use Python or JavaScript regex rules?
JavaScript rules, which match Python closely for everyday patterns like character classes, quantifiers and groups. Advanced features such as lookbehind behave differently and depend on your browser version.
Is my test text private?
Yes. The pattern and text are evaluated by your browser's own regex engine. Nothing is sent anywhere, so you can safely test against real log lines or customer records.
What do the flags mean?
g finds every match instead of the first, i ignores case, m makes ^ and $ match at each line, and s lets a dot match newlines. Combine them, for example gim.
Why did the page freeze on my pattern?
Nested quantifiers such as (a+)+ can backtrack exponentially on non-matching text. Simplify the pattern or anchor it, then reload the tab.