Skip to content
SUMILORASUMILORA

Regular expression tester

Developer tools

Enter a pattern and some text. Matches highlight as you type, and capture groups are listed per match.

Runs in your browser

Nothing is uploaded. The work happens on your own device, so your file or text never reaches us.

About this tool

This is the JavaScript flavour

Regex dialects differ in ways that matter. This runs in your browser’s own engine, so the syntax is ECMAScript: \d, \w, (?<name>…) named groups, lookbehind (?<=…), and the u flag for Unicode properties like \p{Script=Arabic}.

It is not PCRE, Python’s re, or Go’s RE2. Recursion and possessive quantifiers do not exist here. A pattern that works in PHP may need adjusting, and one that works here will usually port to Python with minor changes.

Catastrophic backtracking

A pattern like (a+)+b against a long run of as can take exponential time — the engine tries every way of dividing the string before giving up. On a server that is a denial-of-service vector with its own name, ReDoS.

Matching here is time-bounded so the page cannot be locked up by one, and a pattern that hits the limit is reported rather than left spinning. Nested quantifiers around the same characters are the shape to watch for.

Questions

Why does my pattern work elsewhere but not here?

Dialect. This is JavaScript regex; PCRE and Python have features it lacks, including recursion and possessive quantifiers.

How do I match accented or non-Latin letters?

Use the u flag and Unicode property escapes: \p{L} for any letter, \p{Script=Arabic} for Arabic. \w is ASCII-only.

Related tools