Skip to main content

Regex Tester

Write a regex and watch matches highlight live — with groups, flags, and a replace preview.

100% freeRuns in your browserNo signup, no watermark

Regular expressions fail silently: one wrong character and your pattern matches nothing — or everything. This tester highlights matches in your test text as you type, lists every match with its numbered and named capture groups and index, and previews replacements (including $1 group references) so you can verify a pattern before it goes anywhere near production code.

It uses the JavaScript regex engine — the same one in Node and every browser — with toggles for all six flags (g, i, m, s, u, y) and starter patterns for emails, URLs, IPv4 addresses, dates, and phone numbers. Log lines, user data, and half-finished patterns stay in your browser; nothing is sent to a server.

How to test a regular expression

  1. 1

    Type your pattern (no surrounding slashes needed) and toggle flags like g and i.

  2. 2

    Paste test text — matches highlight instantly and each match’s groups appear in the table.

  3. 3

    Optionally enter a replacement string to preview the result, then copy it.

Why use Nofolo’s regex tester?

Live highlighting

Matches light up in the test text on every keystroke — no run button.

Group capture table

Each match listed with its index, numbered groups, and named groups.

Replace preview

Try a replacement string with $1 or $<name> references and copy the result.

All six flags

Toggle g, i, m, s, u, and y with one click each — the effect is instant.

Pattern library

One-click starters for email, URL, IPv4, ISO date, and phone patterns.

Local and safeguarded

Matching runs in your browser, capped at 5,000 matches so runaway patterns stay manageable.

Frequently asked questions

Which regex flavor does this tester use?

JavaScript (ECMAScript) — identical to Node.js and every browser. Most patterns port from PCRE and Python, but features such as lookbehind and Unicode classes vary by flavor, so always test in the engine you will deploy on.

What do the g, i, m, s, u, and y flags mean?

g finds all matches instead of just the first; i ignores case; m makes ^ and $ match at line breaks; s lets the dot match newlines; u enables full Unicode handling; y requires each match to start exactly where the last one ended.

How do I use capture groups in the replacement?

Reference numbered groups with $1, $2, … and named groups with $<name>. For example, pattern (\d{4})-(\d{2}) with replacement $2/$1 turns 2026-07 into 07/2026.

Why does my regex hang or run slowly?

Nested quantifiers like (a+)+ can trigger catastrophic backtracking. This tester caps results at 5,000 matches, but a pathological pattern can still stall any JavaScript engine — prefer specific character classes over stacked .* quantifiers.

Is my test text sent anywhere?

No. Matching runs in your browser’s own regex engine. Log excerpts, sample data, and patterns never leave your device.

Related tools