Toolivaro

Free Regex Tester

Test regular expressions live against your own text with match highlighting, capture groups, and flags — fully local.

The regex tester validates a pattern and shows every match against your own text as you type — no round trip to a server. Paste or type any text, enter a pattern, toggle the standard flags (global, case-insensitive, multiline, dot-all, unicode, sticky), and the tool lists each match with its position, the matched text, and the capture groups it produced. Patterns are compiled with the platform’s ECMAScript RegExp engine, so the behavior you test here is exactly the behavior you get in JavaScript, Node.js, and every modern browser — the tool promises engine fidelity, not a lookalike dialect. Malformed patterns return the platform error message so you can fix them quickly, and a safety cap on match scanning keeps pathological patterns from freezing the page. Everything runs locally in your browser: the text you paste — log excerpts, configuration, personal data — is never uploaded, logged, or stored. Use this tool while writing a validator, debugging a log parser, or before relying on a pattern in production code.

Processed locally in your browser

Flags

How to use this calculator

Building a pattern the way the engine sees it

A regular expression is a miniature program: the engine walks your text, and at every position it asks whether the pattern matches starting there. The tester makes that walk visible — every match is listed with its position, the exact text it matched, and the capture groups it produced, updated as you type. Start with the literal that must appear (request_id=, say), add the flexible parts around it (a w+ for the value), and check the result against real lines from your data before you trust it anywhere.

The engine here is the platform’s ECMAScript RegExp — the same one JavaScript, Node.js, Deno, and every modern browser use. That is the point of the tool’s fidelity promise: a pattern that matches here matches in your code, and one that fails here will fail there. Dialects like PCRE (PHP, grep, regex101’s default) have features ECMAScript lacks or spells differently — lookbehind syntax, named-group conventions, atomic groups — and the tester rejects them with the platform’s error message rather than pretending to support a dialect it does not run.

Using the flags deliberately

Flags are not decorations — they change what the pattern means. Without g, the engine stops at the first match, and the classic "why does my pattern match once?" confusion is usually a missing g. Without m, the anchors ^ and $ bind to the whole string, not to line boundaries, so a pattern that should match each log line silently matches nothing when the text has multiple lines. The s flag is the one that surprises everyone: . matches every character except line breaks unless s is set, so patterns that should span lines fail on the newline. And the difference between the unicode u and non-unicode modes changes how astral characters like emoji are treated — a point where the ECMAScript engine is stricter than older dialects.

The tester shows the flags you have set at a glance and re-runs the scan on every change, so each flag’s effect is visible the moment you toggle it. That is the fastest way to learn what a flag does: switch it, watch the match list change.

Reading matches, groups, and failures

Each result row shows the matched text, its start position, and its capture groups — the parts of the pattern inside parentheses, which are the values your code will actually consume. The classic use is extraction: with /request_id=(w+)/g against a log line, group 1 holds the id, and the tester shows both matches and their group values before you wire the pattern into a pipeline.

A pattern that matches nothing is a bug report, not a puzzle: the tool shows every match position so the failure is visible at a glance — the pattern matched a different place than you expected, or matched zero times because of a missing flag, a literal space, or an anchor bound to the wrong position. Malformed patterns return the platform’s own error message, which names the position of the problem, so fixing is a matter of reading the message rather than guessing.

Safety and the honest limits

Regular expressions can be pathological: certain patterns take exponential time on certain inputs — the classic "catastrophic backtracking" failure mode — and the tester caps match scanning so a hostile pattern cannot freeze the page. The cap is disclosed; extremely large texts or pathological patterns are truncated with a notice rather than run to completion.

Two things the tool deliberately does not do: it does not judge whether a pattern is efficient enough for production traffic (that is a load-testing question), and it does not claim your pattern is correct in the abstract — it shows what the engine does with your text, which is the only honest answer. And because patterns and pasted text often contain credentials and personal data, everything runs locally: nothing is uploaded, logged, or stored.

How is the result calculated?

Extracting IDs from log lines

Given log lines like "2026-08-05 09:30 ERROR request_id=7f3a user=ada", the pattern /request_id=(\w+)/g matches each request id and captures the value into group 1. The tester lists both matches with positions and their captured groups, so you can confirm the pattern before using it in a log pipeline.

Example input and output
Input Value
text 2026-08-05 09:30 ERROR request_id=7f3a user=ada 2026-08-05 09:31 ERROR request_id=9c21 user=bob
pattern request_id=(\w+)
flags g
Result 2 matches · group 1: 7f3a, 9c21

What is the formula and its assumptions?

Matching semantics

matches = text.scan(pattern, flags)

Formula terms
Symbol Meaning
pattern ECMAScript regular expression (platform RegExp engine)
flags g (global), i (ignore case), m (multiline), s (dot-all), u (unicode), y (sticky)

Behavior is exactly the platform engine’s — what matches here matches in JavaScript, Node.js, and browsers.

What are the most common mistakes?

  • Testing with the g flag but reading only the first result — with /g the engine advances through every match.
  • Expecting PCRE features (like lookbehind before ES2018) in an ECMAScript pattern.
  • Forgetting that . does not match newlines unless the s flag is set.
  • Pasting patterns or text containing secrets into a web service — this tool is fully local.

What are the assumptions and limitations?

  • The dialect is ECMAScript only; PCRE/RE2-style features not in ECMAScript are rejected with the platform error.
  • Match scanning is capped for safety; extremely large texts or pathological patterns may be truncated with a notice.
  • The tool shows what the engine matches — it cannot judge whether a pattern is efficient or safe for a production workload.

Where do the numbers come from?

Last reviewed August 5, 2026 · Version 1.0.0 · Toolivaro does not guarantee external content.

Frequently asked questions

Which regex dialect does this tool use?

The platform’s ECMAScript engine — the same dialect JavaScript, Node.js, Deno, and browsers use. Dialects like PCRE (PHP, grep, regex101’s default) have extra features such as lookbehind in different forms and named groups with different syntax; those are not part of ECMAScript.

Why did my pattern match nothing?

Common causes: missing the g flag when you expect multiple matches, forgetting that anchors like ^ and $ match line boundaries only with the m flag, and patterns that accidentally include literal spaces. The tool shows every match with its position so the failure is usually visible at a glance.

Is my text sent anywhere?

No. The pattern and the text are processed entirely in your browser tab — nothing is uploaded, logged, or stored. This matters for log excerpts and configuration files that often contain credentials or personal data.

What does the u (unicode) flag actually change?

It switches the engine to strict Unicode mode: astral characters (emoji, rare scripts) are treated as single code points instead of surrogate halves, and some otherwise-lenient syntax becomes an error. Patterns that work without u can behave differently with it — the tester makes the difference visible as you toggle.

Can I use the same pattern in Python or Go?

Not safely — those languages use different engines (Python’s re, Go’s RE2). The fidelity promise here is specifically ECMAScript: what matches here matches in JavaScript, Node.js, Deno, and browsers. Porting a pattern to another language means re-testing it in that language’s tester.

Part of Developer text and JSON toolkit

Found a mistake or have a correction? Report it — we review every correction.

Was this helpful?

Reviewed by the Toolivaro editorial team per our methodology Methodology · Editorial policy