Skip to main content

Regex Tester

Test regular expressions with live match highlighting

How to Use Regex Tester

  1. Enter your pattern and set the flags you need.
  2. Paste test text into the input area.
  3. Matches highlight live as you type, with capture groups listed below.

About Regex Tester

What this page solves

Pasting a pattern and real sample data into a hosted regex tester leaks whatever you were matching against — log lines, customer emails, API payloads. This one evaluates the pattern in your own JavaScript engine.

Regex Tester evaluates JavaScript regular expressions against your sample text as you type, highlighting every match, listing capture groups, and reporting match counts — with the whole evaluation running in your browser's own RegExp engine. Because it uses the same engine your application will use, what you see here is exactly what `String.prototype.match` will do in production, unlike testers built on PCRE that quietly accept syntax V8 rejects. Flags (`g`, `i`, `m`, `s`, `u`, `y`) are toggleable, named capture groups are listed by name, and an invalid pattern reports the engine's own error rather than a generic failure. It is built for the real jobs: tightening an email or postcode validation rule, extracting IDs from a log dump, writing a find-and-replace for a large refactor, or debugging why a pattern matches one line too many. Pair it with the Regex Generator when you want a starting pattern from a description, or the JSON Formatter when your sample data is a raw API response. Runs entirely in your browser — no upload, no signup, no logs.

Common Use Cases

  • Tighten an email, phone, or postcode validation rule before shipping it
  • Extract request IDs or timestamps from a pasted production log excerpt
  • Debug a pattern that matches one line too many in a find-and-replace
  • Build a capture-group pattern for a scraping or parsing script
  • Test a URL-rewrite or redirect pattern before adding it to server config
  • Check that a pattern behaves the same with and without the global flag

See all Developer Tools.

Frequently asked questions

Why does my pattern only match once?

You need the global flag. Without it, matching stops at the first result. This trips people up constantly because the pattern itself looks correct.

What is catastrophic backtracking?

Certain patterns, typically nested quantifiers like (a+)+, can take exponential time on inputs that nearly match. The engine tries every possible split before giving up. On a long input this hangs the browser, and in a server context it is a denial-of-service vector.

Does this match other regex flavours?

It uses the JavaScript engine. Most basic syntax is portable, but lookbehind, named groups and Unicode property escapes vary between JavaScript, PCRE, Python and Go. Test in your target language before relying on it.

How do I match across multiple lines?

The multiline flag makes the anchors match at line boundaries rather than only at the start and end of the whole string. The dotall flag makes the dot match newlines too. They solve different problems and are often confused.

How to use Regex Tester?

1) Open the tool. 2) Enter or upload your input. 3) Get your result instantly. Everything happens locally — nothing is uploaded.

When should I use Regex Tester?

Use it while writing a validation rule, a log-parsing pattern, or a find-and-replace, when you need live match feedback against real sample data.

Is Regex Tester safe?

Yes. Regex Tester runs 100% in your browser. Inputs are never uploaded, stored, or logged — safe for confidential content.

Will quality be affected by Regex Tester?

Regex Tester performs lossless operations — your content is not re-encoded or downgraded.

What formats does Regex Tester support?

Regex Tester supports JSON, YAML, XML, CSV, TOML and other developer-friendly text formats

Is Regex Tester free?

Yes — Regex Tester is completely free, with no registration, no watermarks, and no usage limits.

Which regex flavour does it use?

JavaScript (ECMAScript) via your browser's built-in RegExp. Lookbehind, named groups, and Unicode property escapes work in modern browsers. PCRE-only constructs like recursive patterns are not supported — by design, because your JS runtime does not support them either.

Is my sample data sent anywhere?

No. The pattern and the text are evaluated locally, which is what makes it safe to paste real log lines or customer records while debugging.

Why does my pattern hang the page?

Nested quantifiers such as `(a+)+b` can trigger catastrophic backtracking on long input. Simplify the pattern, anchor it, or make the inner quantifier lazy — the same fix your production code will need.

Can I see capture groups?

Yes. Each match lists its numbered groups, and named groups appear under their names, which is the fastest way to confirm an extraction before wiring it into code.

Does the global flag change the results?

Yes. Without `g` only the first match is returned; with `g` every match is listed. Toggle it to see exactly how your call site will behave.