Skip to content

Regex tester

Type a pattern and watch it match as you type. Every token is explained in plain English, and capture groups are listed underneath.

pattern
Presets:
test string

3 matches

explanation

Groups

describe it · AI
Sends your description and the first 800 characters of the test string.

How to read a regular expression

A regex is a sequence of small instructions read left to right: match this character, then one of these, then repeat that. The explanation panel breaks your pattern into exactly those steps, and indents the steps inside a group so you can see its structure.

The three things that trip people up most: forgetting the g flag (only the first match is found), greedy quantifiers (.* swallows as much as it can; use .*?), and unescaped dots (. means any character; write \. for a literal dot).

The full syntax, with lookarounds, flags and common patterns, is on the regex cheat sheet.

Frequently asked questions

Which regex flavour does this tester use?

Your browser’s JavaScript (ECMAScript) engine, the same one used by Node.js and TypeScript. It supports lookbehind, named groups, the s (dotAll) flag and Unicode property escapes. Python’s re module is very similar; the main difference is named groups written as (?P<name>…).

Why does my pattern only find the first match?

Turn on the g (global) flag. Without it, JavaScript stops after the first match.

How do I use capture groups in the replacement?

Refer to numbered groups as $1, $2 and named groups as $<name>. $& inserts the whole match.

Is my text sent anywhere?

No. Matching runs locally as you type. Only if you use the “Describe it” AI box are your description and a short sample of the test text sent to the AI model.