Regex Tester

Build, test and debug regular expressions live — with match highlighting, capture groups and replace.

//

0 matches

Presets:
Matches appear here…

About Regular Expressions

A regular expression (regex) is a sequence of characters that defines a search pattern. This tester uses your browser's native JavaScript regex engine, so behavior matches exactly what you'll get in Node.js and the browser. Nothing is sent to a server.

Toggle flags on the right of the pattern: g global, i ignore case, m multiline, s dotall, u unicode, y sticky.

Frequently asked questions

Which regex flavor does this use?

It uses the native JavaScript (ECMAScript) regular expression engine — the same one running in your browser and in Node.js. Syntax is very close to PCRE, but a few constructs like possessive quantifiers and recursion are not supported.

What do the g, i and m flags do?

g (global) finds all matches instead of just the first, i makes matching case-insensitive, and m (multiline) makes ^ and $ match at line breaks. There are also s (dotAll), u (unicode) and y (sticky) flags.

How do I use capture groups in the replacement?

Reference a numbered group with $1, $2, and so on, or a named group (?<name>...) with $<name>. The replace preview updates live as you type both the pattern and the replacement string.