Regex Tester — Online Regular Expression Tester

🔒 Runs in your browser — nothing is sent to a server

Regex tester for live debugging of any regular expression in your browser. Type a pattern, toggle the `g`, `i`, `m`, `s`, `u`, `y` flags and watch every match light up inline in your test string while the match list shows numbered and named capture groups. The same regex tester works for JavaScript, PCRE-style and Python flavours — minor syntax differences are noted, the engine itself is the browser's native `RegExp`. Everything runs 100% inside your browser; the pattern and test string never leave your device, nothing is uploaded, logged or sent to any server. A 1-second safety timer aborts catastrophic backtracking automatically.

//g
Contact us at hello@example.com or sales@chișinău.md — both regex tester examples are valid email addresses.
  1. #1at index 14hello@example.com
Cheatsheet — common regex constructs
  • \d — digit (0–9)
  • \w — word char (letter, digit, underscore)
  • \s — whitespace
  • . — any character (except newline unless s)
  • ^ / $ — start / end of string (or line with m)
  • \b — word boundary
  • [a-z] — character class
  • [^abc] — negated class
  • a? — 0 or 1
  • a* — 0 or more
  • a+ — 1 or more
  • a{2,4} — between 2 and 4
  • (abc) — capture group
  • (?:abc) — non-capturing group
  • (?<name>abc) — named capture
  • (?=abc) — positive lookahead
  • (?!abc) — negative lookahead
  • (?<=abc) — positive lookbehind

Why use a live regex tester instead of writing patterns in code

Iterating on a regex inside an editor is slow — every change means a save, a re-run, sometimes a redeploy. A live regex tester collapses that loop to single keystrokes: change a character, see matches and capture groups update, toggle a flag, watch the highlight redraw. Sharing a one-off pattern with a colleague? Paste it here, pin the URL, walk through the matches together. The tool does not store, log or transmit anything, so production logs and PII can be pasted without leaving your machine — far safer than the SaaS regex tester pages that quietly index whatever you type.

Reading the match list and inline highlights

Two views work in tandem. The right pane mirrors the test string and highlights every match inline so the visual shape of the data is preserved — useful for confirming that a multiline anchor lines up where you expect, or that a greedy quantifier is not swallowing more than intended. The match list below is the structured view: position, full match text, then numbered and named capture groups in the order the pattern declares them. Optional groups that did not participate in the match render as `undefined`, exactly like `String.prototype.matchAll` exposes them in JavaScript.

Examples

Input
/\b[\w.+-]+@[\w-]+\.[\w.-]+\b/g
Output
Matches: hello@example.com, sales@chișinău.md
Regex tester for an email address pattern
Input
/(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})/
Output
Match: 2026-04-26 → year=2026, month=04, day=26
Test regex with named capture groups
Input
/T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z?/gi
Output
Matches: T09:15:00Z, T14:03:27.842
Regex match checker for ISO times (g + i flags)
Input
/\b(\w+)\s+\1\b/gi
Output
Match: "the the" → group 1 = "the"
Regular expression tester — find duplicate words

FAQ

How do I use this regex tester?

Paste your regular expression into the pattern box, pick the flags you need (`g`, `i`, `m`, `s`, `u`, `y`) and drop the text you want to match into the test string area. The regex tester evaluates live and highlights every match inline, then lists numbered and named capture groups. No upload, no account — the pattern and the input never leave your browser.

Which regex flags does this regex tester support?

All six native JavaScript flags: `g` (global, find every match), `i` (case-insensitive), `m` (multiline — `^` and `$` match line breaks), `s` (dotall — `.` matches `\n`), `u` (full Unicode, including astral plane and `\p{…}`), and `y` (sticky, match starting at `lastIndex`). Toggle any combination from the flag bar; the live result updates as you type.

Is this a JavaScript regex tester or a Python regex tester?

The engine is the browser's built-in `RegExp` object, so JavaScript syntax is exact. Python and PCRE share roughly 95% of the same syntax — `\d`, `\w`, character classes, quantifiers, lookarounds and named groups all behave the same. Pick the Python or PCRE flavour to be reminded of the small differences (e.g. Python's `(?P<name>…)` syntax is rewritten to `(?<name>…)` for evaluation).

How do capture groups appear in the regex tester results?

Every match in the list shows its position, the matched substring, and one row per capture group — numbered (`Group 1`, `Group 2`) and named when the pattern uses `(?<name>…)`. Non-capturing groups `(?:…)` do not produce a row. Optional groups that did not match show as `undefined`. This is exactly what `String.prototype.matchAll` returns.

What is catastrophic backtracking and how does the tester guard against it?

Catastrophic backtracking happens when nested quantifiers like `(a+)+`, `(.*)*` or `(\w+)+$` make the engine try exponentially many ways to fail a match. To keep the page responsive, the regex tester aborts evaluation after one second and shows a warning. Replace nested quantifiers with possessive equivalents — `(a+)+x` becomes `a+x` — to fix the pattern.

Why is my regex matching nothing in the regex debugger?

The most common reasons: missing `g` flag (only the first match is found), an unescaped metacharacter (`.` matches any char, `+` is a quantifier — escape with `\.`, `\+`), or anchors `^` and `$` matching just the start and end of the string instead of each line — add the `m` flag for line-by-line behaviour. Toggle flags one at a time and watch the highlight update.

Does the regex tester support Unicode and emoji?

Yes. Enable the `u` flag and you can use Unicode property escapes like `\p{Letter}` or `\p{Emoji}`, surrogate-pair-aware quantifiers, and code points above U+FFFF. Without `u`, an emoji like `😀` is two separate code units and `.` only matches half. With `u`, the regex tester treats it as a single character.

Glossary

Regular expression

A regular expression — regex for short — is a compact syntax for describing string patterns. It mixes literal characters with metacharacters (`.`, `*`, `+`, `?`, `\d`, `\w`, `\s`), character classes (`[a-z]`), quantifiers (`{2,4}`) and anchors (`^`, `$`, `\b`). A regex tester compiles the pattern with chosen flags and runs it against an input, returning each match and its capture groups.

Regex flag

Flags modify how the engine matches. `g` returns every match instead of stopping at the first; `i` makes letter matching case-insensitive; `m` lets `^` and `$` anchor to line boundaries inside the string; `s` makes `.` match newline characters; `u` enables full Unicode mode with property escapes and proper handling of code points above U+FFFF; `y` requires each match to start exactly where the previous one ended.

Capture group

A capture group is the parenthesised section of a pattern whose match is remembered for later use — by index (`Group 1`) or by name (`(?<name>…)`). The regex tester lists every group per match. Use `(?:…)` for grouping without capturing if you only want the structure for alternation or quantification but do not need the substring back.

Lookaround

Lookahead `(?=…)` and lookbehind `(?<=…)` (and their negative forms `(?!…)`, `(?<!…)`) are zero-width assertions: the engine checks that the surrounding text matches a sub-pattern but does not consume any characters. Useful for matching a digit only when followed by `px`, or a word not preceded by `un`. Modern V8 and most engines support both directions.

Catastrophic backtracking

A pathological state where overlapping quantifiers force the engine to retry exponentially many partial matches before deciding the input does not match. The regex tester guards against this with a 1-second cutoff. Avoid nested quantifiers like `(a+)+`, `(.*)*` or `(\w+)+$`; rewrite them so each character has a single matching path.

Related tools