Open Tools LibraryOpen Tools Library
Developer Tools

Regex Tester

Live match highlighting, named groups, and a replace-mode preview — in one tool.

Also known as: Regular expression tester, Regex checker, Regex debugger

100% FreeNo Signup RequiredLive Match HighlightingReplace-Mode Preview
100% local — nothing you enter here ever leaves this browser tab
Loading tool…
Step by step

How it works

  1. 1Type or paste a regular expression pattern, and toggle the flags you need (g, i, m, s, u).
  2. 2Type or paste a test string — matches highlight live as you adjust the pattern.
  3. 3Review each match's full text and its numbered/named capture groups below.
  4. 4Optionally turn on replace mode to preview a find-and-replace result live.
Why OTL

Why use Regex Tester

Live match highlighting

See exactly which characters match, directly inside your test string, as you type.

Full capture-group breakdown

Every match shows its numbered and named groups individually, not just a pass/fail.

Replace-mode preview

See the actual result of a find-and-replace pattern before using it for real.

Ready-made common patterns

One-click patterns for email, URL, IPv4, hex color, phone numbers, and dates.

All standard flags supported

Toggle global, case-insensitive, multiline, dotAll, and unicode flags individually.

Fully local

Matching runs on your browser's own regex engine — nothing is sent anywhere.

Real-world use

Who uses Regex Tester

Building a form validation pattern

Test an email or phone number pattern against real example inputs before shipping it.

Writing a log-parsing regex

Use capture groups to confirm each field extracts correctly from a sample log line.

Planning a find-and-replace across a codebase

Preview the exact replacement result before running it for real.

Debugging a regex that isn't matching

See live highlighting to spot exactly where a pattern stops matching as expected.

Learning regex syntax

Start from a common pattern and modify it to see how each part affects the match.

Extracting structured data from text

Use named capture groups to pull out specific fields like dates or IDs from unstructured text.

Deep dive

About Regex Tester

Writing a regular expression is often a cycle of guess, test, squint at the result, and adjust — and that cycle is only as fast as your tool lets it be. Many regex testers show you a bare true/false or a match count and leave you to work out which part of your text actually matched. This one highlights every match directly inside your test string as you type, so you see immediately which characters your pattern actually captured, not just whether it captured something.

Capture groups get the same direct treatment. For every match, both numbered groups ($1, $2, and so on) and named groups (?<name>...) are broken out individually with their actual matched values, rather than leaving you to count parentheses by hand or dig through a nested result object. This matters most for exactly the patterns people struggle with — multi-group patterns for parsing dates, URLs, or log lines, where knowing which piece landed in which group is the whole point of the exercise.

Replace mode goes a step further than matching: type a replacement pattern using $1, $2, or $<name> references, and see the actual resulting text live, exactly as JavaScript's own string replace would produce it. This is the difference between confirming a pattern matches and confirming a find-and-replace operation will actually do what you intend — a distinction that matters a lot once you're about to run that same replacement across a real codebase or dataset.

A library of ready-made common patterns — email addresses, URLs, IPv4 addresses, hex colors, US phone numbers, ISO dates — gives you a working, testable starting point with one click, rather than a blank pattern box and a blinking cursor. Every part of this — matching, highlighting, capture-group extraction, replacement preview — runs using your browser's own regular expression engine, entirely on your device.

Compare

Regex Tester vs. other options

How Open Tools Library compares to desktop software and other online tools.

FeatureOpen Tools LibraryDesktop softwareOther online tools
PriceFree, unlimitedOften built into IDEsOften free
Live highlightingYes, in the test string itselfVariesVaries
Capture group breakdownNumbered + named, per matchVariesOften numbered only
Replace-mode previewYes, liveVariesRare
Common pattern library7 built inRareVaries
Data privacyNever leaves your deviceStays localOften sent to a server
Pro tips

Pro tips

  • Turn on the g flag to see all matches highlighted, not just the first one.
  • Named groups (?<name>...) are often clearer than counting numbered groups, especially in patterns with several groups.
  • Test your replacement pattern against several different example inputs, not just one, before using it for real.
  • The m flag changes how ^ and $ behave — turn it on if you need them to match the start/end of each line, not just the whole string.
  • Start from a common pattern in the quick-pattern library and adjust it — it's usually faster than writing one from scratch.
Under the hood

Technical specs

Flags supported
g, i, m, s, u
Capture groups
Numbered and named, shown per match
Replace mode
Live preview with $1/$<name> support
Built-in patterns
7 common presets (email, URL, IPv4, and more)
Engine
Native browser RegExp
Processing location
100% local, in your browser

Privacy & security

Regex patterns are often built and tested against real data — log lines, user input, internal identifiers — so testing one shouldn't require sending that data anywhere.

Pattern matching runs entirely in your browser using its native regex engine.

No account or signup is required to use this tool.

Nothing you type — pattern or test string — is stored or logged anywhere.

Works the same for a public example string as it does for real internal data.

FAQ

Frequently asked questions

Is my pattern or test string sent anywhere?

No. Matching runs using your browser's own built-in regular expression engine, entirely on your device.

What regex flavor does this use?

JavaScript's native RegExp syntax and flags — the same engine used by browsers and Node.js.

How do I test a find-and-replace before using it?

Turn on replace mode and type your replacement pattern (using $1, $2, or $<name> for groups) — the result updates live.

What's the difference between numbered and named groups?

Numbered groups are referenced by position ($1, $2...); named groups use (?<name>...) syntax and are referenced by name ($<name>), which stays readable even in patterns with many groups.

Can I test multiline text?

Yes — paste multiline text into the test string, and turn on the m flag if you need ^ and $ to match line boundaries rather than the whole string's start and end.

Is there a limit on test string length?

No hard limit, though very long strings with many matches may take a moment longer to highlight.

Stuck?

Troubleshooting

My pattern isn't matching anything

Check your flags first — a case-sensitive pattern won't match differently-cased text without the i flag, and without g only the first match is found.

I'm only seeing one match when I expect several

Turn on the g (global) flag — without it, both matching and replace only ever process the first occurrence.

My named group isn't showing in the replacement

Named group references in replacement strings use the syntax $<name>, not $name or {name} — double-check the exact syntax.

The tool shows an error instead of results

This means the pattern itself is invalid JavaScript regex syntax — check for unbalanced parentheses or brackets, shown in the error message.

Ready to use Regex Tester?

Free, private, and ready right now — no signup required.

Scroll to Regex Tester