Regex Tester & Live Preview

Build and debug regular expressions with instant, side-by-side highlighting. Hover any match to link the code and the preview, switch between JavaScript, PCRE, Python and more, and get a plain-English explanation — all in your browser.

This regex tester turns writing regular expressions into something you can actually see. As you type, your test text highlights every match in real time, with capture groups underlined and a live count. The signature two-way hover link connects the code and the preview: hover a match in the text and its result card is emphasized, hover a card and the editor scrolls to that match — so even patterns with dozens of matches stay easy to follow. A syntax-highlighted pattern editor, one-tap flag toggles, and a plain-English explanation panel make it approachable, while Match, Replace and Split modes cover real debugging work. Patterns run on your browser's native engine, with a translation layer that brings PCRE, Python, .NET, Java, Ruby and Go syntax to life and flags anything it can't represent. Save patterns locally, share a link, or copy the literal — all privately, and all offline once the page has loaded.

  • Live side-by-side highlighting that updates as you type
  • Two-way hover linking — hover a match in the text and its result card lights up, and vice versa
  • Full syntax highlighting inside the pattern editor
  • Match, Replace and Split operations with capture-group inspection
  • Named and numbered capture groups with exact positions
  • Plain-English explanation of your pattern, token by token
  • Multiple flavors: JavaScript, PCRE, Python, .NET, Java, Ruby and Go
  • Every flag — g, i, m, s, u, y — as a one-tap toggle with inline help
  • Curated examples for emails, URLs, IPs, dates, logs and more
  • Save patterns locally, share a link, or copy the /pattern/flags literal
  • Works fully offline and adapts to light and dark mode
  • Debug a Stubborn Pattern — Developers building validation or parsing logic watch exactly what matches and what doesn't, with group positions and a plain-English breakdown to pinpoint the problem.
  • Learn Regular Expressions — Students and newcomers experiment with live highlighting, an explanation panel, and a built-in cheat sheet, turning an intimidating syntax into something visual and immediate.
  • Craft Find-and-Replace Rules — Anyone cleaning up text or code previews substitutions with $1 and named-group references before applying them in their editor or codebase.
  • Port Patterns Between Languages — Teams moving a regex from Python or PCRE to JavaScript see how the syntax translates and which constructs need attention, all in one place.
  • Validate and Extract Data — Analysts test patterns for emails, URLs, IP addresses, dates, and log lines against real samples, then copy the working pattern with confidence.

How It Works

1

Write your pattern

Type a regular expression in the syntax-highlighted editor and toggle flags like g, i and m. A friendly error appears the moment something is off.

2

See matches highlight live

Your test text highlights every match instantly, with capture groups underlined. Hover a highlight and the matching result card lights up — hover a card and it jumps to the text.

3

Match, replace or split

Switch operations to preview a substitution with $1 and $<name> references, or see exactly how the pattern splits your input.

4

Understand and reuse

Open the explanation panel for a plain-English breakdown, save patterns locally, or copy a shareable link — all without anything leaving your browser.

Frequently Asked Questions

Is my text private?

Completely. The editor, the regex engine, and storage all run inside your browser. Your patterns and test text are never sent to a server — there are no uploads and no tracking.

Which regex flavors are supported?

Patterns execute on your browser's native ECMAScript (JavaScript) engine, which fully supports named groups, look-behind, Unicode property escapes and more. For PCRE, Python, .NET, Java, Ruby and Go, common flavor-specific syntax — such as (?P<name>…) groups, \A / \z anchors and POSIX classes — is translated automatically, and anything that can't be represented natively is clearly flagged.

How does the hover linking work?

Every match in your test text is connected to a card in the results panel. Move your cursor over a highlighted match and its card is emphasized; hover a card and the tool scrolls to and highlights that match in the text. It makes complex patterns with many matches easy to follow.

Can I see capture groups?

Yes. Each match lists its numbered and named capture groups with their exact start and end positions, and groups are underlined inside the text. Groups that didn't participate in a match are shown explicitly.

Can I test replacements?

Yes. Switch to Replace mode and enter a replacement string using $1, $2, $<name>, $& and related references. The rewritten output renders live with the replaced spans highlighted.

Are my patterns saved?

Your current workspace is remembered between visits in local storage, and you can save named patterns to a local library backed by IndexedDB. Everything stays on your device; use a shareable link to move a pattern elsewhere.

Does it work offline?

Yes. Once the page has loaded, everything works without a connection, including matching, replacing, and your saved patterns.