WoluTools
← About this tool

developer · Browser tool

Regex Pattern Tester

Run a regular expression over your own text, inspect every match and capture group, and read back what the pattern actually says.

Runs in your browserNothing is uploadedHow it works
Free toolNo account · no job limitFree, unlimitedRuns offline once the page has loaded.

Pattern

Flags

Test subject

Matches

What the pattern says

How matching actually works here

The engine on this page is the one built into your browser. There is no server call and no second implementation, so what you see is exactly what the same pattern will do in JavaScript. Other engines differ: PCRE, Python's re, Go's RE2 and the POSIX tools all have their own syntax corners. Lookbehind, named groups and the s flag are recent additions to JavaScript and may not exist wherever you paste the pattern next.

Why a pattern can hang a program

Backtracking engines try alternatives when a match fails. A pattern such as (a+)+b run against a long run of the letter a has an enormous number of ways to split that run, and the engine walks through them all before giving up. The time taken doubles with each extra character, so twenty-five characters of input can take longer than the rest of the day. This is how a single bad expression takes down a web service, and it has a name: ReDoS.

Matching here happens on a background thread with a time budget of just under a second. If the budget runs out the thread is stopped and you get a warning instead of a frozen tab. That is a signal worth taking seriously — the same pattern on a busy server has no such escape hatch. Nested quantifiers and alternations that can match the same text two ways are the usual cause.

Reading the explanation

The breakdown walks the pattern left to right and names each part. Indented rows sit inside a group. It covers the constructs JavaScript supports today and will fall back to describing an unfamiliar part literally rather than guessing. Character classes are summarised, not expanded, so [a-z0-9_] is described by its ranges.