Free

Regex Tester & Explainer

Matches, capture groups and a plain-English reading of the pattern - with a watchdog that catches the patterns that would otherwise hang the tab.

  • Free forever
  • No signup
  • Runs in your browser

At a glance

Takes
A pattern, your flags, and the text to test it against
Returns
Every match and capture group, plus an explanation of the pattern
Handles
Runs in a worker with a timeout, so a catastrophic pattern cannot hang the page
Privacy
Runs in your browser - nothing you paste is uploaded

Nothing you type leaves this page

This tool runs entirely in your browser. Nothing you type or paste is sent to Revquix or to anyone else, no account is needed, and the page keeps working with your network disconnected.

Full detail in our privacy policy and AI policy.

How this works

About Regex Tester

What it checks, what it deliberately does not, and how to read the output.

Why this one cannot hang your browser

A JavaScript regular expression cannot be interrupted. Once the engine starts backtracking there is no timeout and no way to abort, which is why so many online regex testers freeze the tab on a pattern like (a+)+$ tested against a long run of the same character. That pattern asks the engine to try an exponential number of ways to split the input, and on thirty characters it is already about a billion attempts.

So the match runs in a Web Worker - a second thread - with a one-second watchdog on the main thread. If the worker has not answered by then it is terminated outright, which is the only mechanism in the platform that can stop a runaway regex, and the result is reported as a finding rather than an error. That finding is worth having: the same pattern would pin a CPU in production, which is the ReDoS class of vulnerability, and most testers will simply die rather than tell you.

What you get back

Every match with its index, line and column, and each capture group listed by number or by name - including groups that did not participate, which are shown as such rather than omitted, because a group matching nothing and a group matching an empty string are different situations and confusing them is a real bug.

Replacement mode uses the browser's own substitution syntax, so $1, $<name>, $& and $$ behave exactly as they will in your code rather than in a re-implemented dialect. Split mode shows every part including the empty ones.

  • Flags i, m, s and u as switches, with what each one changes
  • Named capture groups via the (?<name>...) syntax
  • Match, replace and split modes over the same pattern
  • A hint when a failed match would have succeeded with the i or m flag

The pattern, read out loud

The explanation panel walks the pattern token by token: what each character class matches, which groups capture and which do not, what a quantifier repeats and whether it is lazy, and what a lookahead asserts without consuming. It is a flat left-to-right reading rather than a nested one, because a partial parser's failure mode is a confidently wrong explanation.

What it will not do

This is the JavaScript flavour. PCRE, Python, Go's RE2 and .NET differ in ways that matter - recursion, atomic groups, possessive quantifiers and variable-length lookbehind are absent here - so a pattern verified on this page is verified for JavaScript, and Go's RE2 in particular deliberately has no backtracking at all, which is why it cannot suffer the problem described above.

It also will not write a regular expression for you, and it will not tell you that a pattern is correct - only what it matches against the text you supplied. A pattern that passes on three examples and fails on the fourth is the normal outcome of testing with too few examples.

FAQ

Questions people actually ask

The ones that come up before somebody uploads anything.

What does “this pattern is too slow” mean?

It means the match was stopped after one second, which almost always indicates catastrophic backtracking from nested quantifiers such as (a+)+ or (\d+)*. It is a real property of the pattern rather than a limit of this page: the same expression would consume CPU indefinitely in your application, which is the ReDoS vulnerability class.

Which regex flavour is this?

JavaScript, running in your own browser's engine. That makes it exactly right for verifying a pattern you will use in JavaScript or TypeScript, and only approximately right for PCRE, Python or Java, which support constructs JavaScript lacks and occasionally differ on Unicode handling.

Why is the global flag always on?

Because this tool lists every match rather than only the first, which requires it. It changes nothing about which strings match - only how many the engine reports. Bear in mind that a global regex object carries state in lastIndex, which is a common source of surprise when one is reused in application code.

Do I include the slashes around the pattern?

No. Write the body only, and use the flag switches instead of a trailing letter. If you paste something like /\d+/g the slashes will be treated as literal characters to match, which is almost never what you meant.

Is my test data sent anywhere?

No. The worker that runs the match is a second thread inside your own browser, not a server. Nothing you type leaves the tab, and the page continues to work with the network disconnected.

Next, try one of these

More from Developer, or browse the full catalogue.

When the regex is the wrong tool

Some of what you are matching wants a parser, not a pattern

HTML, nested structures, and anything with balanced delimiters are the classic cases where a regex looks like it works right up until production. An hour with a senior engineer on the parsing problem underneath is usually shorter than the afternoon you were about to spend on the pattern.

Talk to an engineer from ₹549/hr