ToolChop

Regex Tester

Test JavaScript regex with live match highlighting and capture-group breakdown. Runs entirely in your browser — paste production logs, API responses, or PII without leaking them.

//
0 matches

Captures (0)

No matches yet.

How to test a regex online

Enter your pattern in the / / input. Toggle flags with the small buttons next to it — hover for a description of each. Paste your test string into the Test string box, and ToolChop highlights every match live. The Captures panel breaks each match into numbered groups ($1, $2, …) and named groups, with the match index in the source text. It updates as you type either side.

Why a local regex tester matters

The data people paste into a regex tester is almost always sensitive: production log lines, API responses with auth tokens, CSV exports, customer records they are about to redact. Uploading any of that to a third-party tester is a needless leak. ToolChop runs the regex entirely in your browser using JavaScript's built-in RegExp, so the pattern and test string never leave your machine.

What flavor of regex is this?

JavaScript / ECMAScript 2018+. That gives you lookbehinds ((?<=...), (?<!...)), named capture groups ((?<name>...)), Unicode property escapes (\p{L}), the s flag for dotAll, and the y flag for sticky matching. Patterns from Python or PCRE will mostly port over — the exceptions are atomic groups, possessive quantifiers, and recursive patterns, which JavaScript does not support.

What you can do

Frequently asked questions

How do I test a regex online for free?

Type your regex pattern into the / / input at the top. Toggle the flag buttons next to it (g, i, m, s, u, y). Paste your test string into the Test string box. ToolChop highlights matches live, lists every capture group, and tells you how many matches were found. No account, no upload, no daily limit.

Does ToolChop send my regex or test string to a server?

No. Regex execution runs entirely in your browser using JavaScript's built-in RegExp. Your pattern and your test string never leave your device — which matters because regex testers often get fed real production log lines, API responses with auth tokens, and user PII you are trying to redact.

Why is the privacy story for a regex tester important?

The data you paste into a regex tester is almost always sensitive: log lines you are debugging, API responses with tokens, customer records you are about to redact, or CSV exports you are about to parse. Uploading any of that to a third-party regex site is a needless data leak. ToolChop runs the regex locally so the data never goes over the wire.

What regex flavor does ToolChop support?

JavaScript regex — specifically the ECMAScript 2018+ RegExp dialect that runs in modern browsers. This includes lookbehinds ((?<=...) / (?<!...)), named capture groups ((?<name>...)), Unicode property escapes (\p{L}), the s flag for dotAll, and the y flag for sticky matching. Patterns valid in JavaScript will work here exactly the same.

What do the flag buttons do?

g — global, find all matches instead of just the first. i — case-insensitive. m — multiline, ^ and $ match per line. s — dotAll, . matches newlines. u — Unicode mode, enables \p{} property escapes. y — sticky, anchor each match at lastIndex (rare). ToolChop always runs with g internally to enumerate all matches, but other flags are exactly as you set them.

Why am I seeing fewer matches than I expect?

Three common causes. (1) You forgot the g flag and only the first match is reported. (2) Your . does not match newlines unless you add the s flag. (3) Your ^ and $ only match string start/end without the m flag — they will not match between lines. ToolChop auto-adds g to enumerate matches, so cause (1) is handled — but the test string panel will show only the matches the rest of your flags allow.

How do named capture groups appear in the output?

Named groups created with (?<name>...) appear in the Captures panel below the numbered groups, prefixed by the group name in green. They are also accessible programmatically as match.groups.name in JavaScript.

What happens if my regex has a zero-width match?

Patterns like ^, $, \b, or (?=...) produce zero-width matches. ToolChop renders these as a thin highlight in the source text and shows them in the Captures panel as (zero-width). ToolChop also detects and breaks out of infinite loops that would otherwise occur from advancing zero through zero-width matches.

Is there a match limit?

Yes, 10,000 matches per run, to keep the UI responsive. Most regex testing involves dozens of matches in a few KB of test string — the cap is well above that. If you are scanning a multi-megabyte log file with thousands of matches, do that in a CLI tool.

Why does my pattern throw 'Invalid regular expression'?

Common causes: unescaped special characters ([, ], (, ), {, }, *, +, ?, ., |, ^, $, \), unbalanced parentheses, an empty quantifier (e.g. *), or a backreference to a group that does not exist. The error message includes the offset where parsing failed — fix that character and re-run.

Can I use Perl / Python / PCRE features here?

Mostly yes, but a few PCRE features are not in JavaScript: possessive quantifiers (*+, ++), atomic groups ((?>...)), and recursive patterns. Almost everything else — lookbehinds, named groups, Unicode property escapes, character class subtraction — works in modern JavaScript regex.

Why use ToolChop instead of regex101 or another online tester?

Privacy. regex101 is excellent, but it sends your pattern and test string to its servers to power its features. Most of what people paste into a regex tester is sensitive — production logs, API responses with tokens, customer data being redacted, internal hostnames. ToolChop runs the regex entirely in your browser so nothing leaves your machine. You can verify in DevTools → Network that no request fires when you type.

Runs in your browser Free forever No signup required Files never uploaded
Advertisement

More free tools