pattern.re — 2 tools ● LIVE
Input · pattern + text ECMAScript
/ / g
Output · matches LIVE
Matches0FOUND LIVE
Capture groups0PER MATCH
Named groups0(?<NAME>…)
Test chars0IN THE LAB

Developer Tools · Group 14 of 19

Regex Tools.

Type a pattern and watch every match light up in the test string as you type — no run button, no waiting. The match list breaks each hit into numbered and named capture groups, the flag toggles flip g/i/m/s/u live, and a broken pattern reports the engine's exact error the instant it breaks. Beside it, a searchable cheat sheet where every token loads into the tester with one click. Nothing is uploaded, nothing is stored.

  • Tools02
  • EngineECMAScript
  • Flagsg·i·m·s·u
  • Backendnone
  • Costfree
In order, 01 → 02

One engine, one reference, zero guesswork.

( 01 )

The lab runs on your browser's own ECMAScript RegExp engine — the same one your code will use in production, so what you see is what will ship. Every match is underlined in the test string the moment it exists, listed with its index, and exploded into numbered $1…$n and named <name> capture groups. Flip the g, i, m, s, u flags and the whole picture re-renders. A pattern that stops compiling turns the field red and prints the engine's exact message — no submit button between you and the answer.

Example · named groups, live

/(?<y>\d{4})-(?<m>\d{2})-(?<d>\d{2})/g Released 2024-01-15, patched 2024-02-20.

Released 2024-01-15, patched 2024-02-20. 2 matches · each with <y> <m> <d> spelled out

Use it for building patternsdebuggingformat validationlearning regex

A reference that does something. Every anchor, character class, quantifier, group, lookaround, escape and flag is documented with a one-line explanation — and a ▶ TRY button that loads a working pattern and sample text straight into the tester, flags included. Filter the whole sheet by typing ("look", "digit", "email"), and a row of ready-made common patterns — email, URL, IPv4, ISO date, hex color, UUID, slug — is one click from being yours.

Example · one click from the sheet

▶ TRY  (?<= \$)\d+  ·  positive lookbehind

pattern + sample load into the tester, $100 lights up, the digits match — the $ doesn't.

Use it for quick referencelearningon the jobpattern recipes

Testing rules · the engine is your browser's native ECMAScript RegExp — identical to what runs in production · matching is live on every keystroke of the pattern, the flags and the test string · named groups (?<name>…) and lookbehind are fully supported; \p{…} needs the u flag · zero-length matches (anchors, lookaround) are handled with an infinite-loop guard · a non-compiling pattern is reported with the engine's exact message and matched nothing is harmed · the cheat sheet's TRY button loads pattern, sample and flags together · everything runs locally — your pattern and your data never leave the tab

The privacy promise

Test anything. We couldn't read it even if we wanted to.

This page has no backend and no database. Every match found, every group captured and every error surfaced just now was computed by your browser's own regex engine, inside your own tab — your pattern and your test data never traveled a single centimeter of cable. Close the page and they're gone for good.

✕ SERVER · DATABASE · LOGS · ANALYTICS
  • Databasenull
  • Backendnone
  • Data uploads0
  • Session logs0
Questions

Asked often, answered plainly.

( 02 )
Which regex flavor does the tester use?

JavaScript's native ECMAScript RegExp engine — the same one that runs in every browser. That means full support for named groups (?<name>…), lookbehind (?<=…), Unicode property escapes like \p{L} with the u flag, and dotall with s. PCRE-only constructs like \K or atomic groups aren't part of the ECMAScript spec and won't work here.

Why does my pattern show an error?

The tester surfaces the engine's exact message the moment the pattern stops compiling. The usual culprits are an unbalanced parenthesis or bracket, a dangling quantifier like a lone *, an invalid escape, or a malformed group like (?<). Fix the pattern and the matches reappear instantly — there's no submit button between you and the answer.

What are named groups?

A capture group written as (?<name>…) captures its match under a label instead of just a number, so you can read it as groups.year instead of groups[1]. The tester lists them alongside the numbered groups in every match, clearly marked in blue, which makes complex patterns far easier to reason about.

Why are some of my matches empty?

Anchors (^, $, \b) and lookaround assertions are zero-width — they match a position, not characters, so the matched text is empty. That's correct behavior, and the highlight shows you exactly where they land. The tester also guards against the classic infinite-loop trap where a zero-length match would otherwise run forever.

Is my data saved anywhere?

No. Stack has no backend and no database. Matching happens inside your browser tab and the pattern and test string vanish the moment you close or refresh the page. Nothing is logged, because nothing is ever collected.