About this tool
Type a pattern and a test text and see each match highlighted as you type, with its position, numbered groups ($1, $2…) and named groups (?<name>…). Turn on the flags you need (g, i, m, s, u), try a replacement with $1 or $<name>, and read the explanation of each token — \d, [^a-z], (?=…), {2,4} and the rest — to learn what the pattern really does. Ready-made patterns cover e-mail, URL, hex colours and Brazilian formats such as CPF, CEP, phone numbers and dd/mm/yyyy dates. It uses the same JavaScript engine as your code, runs on your device and stops patterns that would hang (catastrophic backtracking).
How to use it
- 1 Type the regular expression, without the slashes.
- 2 Tick the flags: g for all matches, i to ignore case, m for line by line.
- 3 Paste the test text and look at the highlighted matches and the groups table.
- 4 Optionally type a replacement to preview the result, and read the explanation of each token.
Frequently asked questions
Which regex flavour does it use?
The JavaScript (ECMAScript) engine of your browser — the same one used by Node.js, Deno and front-end code. Most syntax is shared with Java, Kotlin, Python and PCRE, but lookbehind, named groups and Unicode classes can differ slightly between languages.
Why did my pattern stop with "took too long"?
Some patterns, such as (a+)+$ on a long text, make the engine try an exponential number of paths (catastrophic backtracking). The tester runs the pattern separately and stops it after 1.5 seconds so the page never freezes; rewrite the pattern without nested quantifiers.
Is my text sent anywhere?
No. Everything runs in your browser. The pattern and flags go into the link you copy so others can open the same regex, but the test text never does.
Embed this tool
Add this free tool to your own website — copy the code below. It stays up to date automatically.
Tools for your site →