Regex Tester: Test Regular Expressions with Live Highlighting

Test a regular expression against your text and see every match highlighted as you type. Capture groups and a replace preview are shown below.

Loading tool…

How to use the Regex Tester

  1. Type or paste your pattern, or pick a common one such as email or Indian mobile number.
  2. Switch flags on or off (g, i, m, s, u, y, d).
  3. Paste your test text and watch matches highlight.
  4. Check the groups table, open Explain this pattern, try a replacement, then copy the pattern.

About this tool

A regular expression is a compact way to describe a text pattern. This tester uses the regex engine built into your browser, which is the JavaScript (ECMAScript) flavour, so syntax from PCRE, Python or Go, such as possessive quantifiers, recursion or inline modifiers, may not work.

Flags change how a pattern behaves. g finds every match, i ignores letter case, m makes ^ and $ match at line breaks, s lets the dot match a newline, u turns on full Unicode handling, y (sticky) matches only at the exact next position and d adds the start and end index of every match and group. Capture groups appear as columns, with their names for named groups, and the replace box accepts $1, $& and $<name>. Open Explain this pattern for a plain-English breakdown of each part, and the cheat sheet for quick syntax.

Matching runs in a background worker with a 2 second limit, so a pattern with catastrophic backtracking (nested quantifiers such as (a+)+ on long text) is stopped and reported instead of freezing the tab. The count stops at 2000 matches and the table shows the first 200. The built-in patterns are starting points, not validators: a pattern that matches the shape of a PAN or GSTIN does not prove the number is real.

Frequently asked questions

Which regex flavour does this use?

The JavaScript flavour from your browser. It is close to what Node.js and most front-end code use, but not identical to PCRE, Python or Go.

Why does my pattern only show one match?

Turn on the g (global) flag. Without it, only the first match is returned.

How do I use capture groups in a replacement?

Use $1, $2 and so on in the replace box, or $<name> for named groups. $& inserts the whole match.

What happens if my pattern is too slow?

It runs in a background worker. If it takes more than 2 seconds it is stopped and you see a message about catastrophic backtracking.

Is my text sent anywhere?

No. Matching runs entirely in your browser.

Need a custom tool or website?

IDM Valley builds web apps, calculators, AI chatbots and automation for businesses. Fixed prices, code in your name.

Get a free quote

Have a project in mind?

Tell us what you need: a website, landing page, AI chatbot or automation. You get a clear scope and a fixed price within one working day. Free, no obligation.


  • avshack
  • DivineBamboo
  • goldleaf
  • janapril
  • kaizen
  • kwc
  • modv
  • pixelrush
  • revital
  • riderzplanet
  • sandsfashions
  • avshack
  • DivineBamboo
  • goldleaf
  • janapril
  • kaizen
  • kwc
  • modv
  • pixelrush
  • revital
  • riderzplanet
  • sandsfashions