All calculators·Regex tester

Regex tester

Test a regular expression against sample text and see every match

Write the pattern without slashes

Enter the pattern itself, not /pattern/flags. Flags go in their own boxes. This avoids the usual confusion about whether a slash in the middle needs escaping.

Groups are where the value usually is

The match is the whole hit; capture groups are the parts you actually wanted. Every group is listed under its match, numbered from one, so you can see straight away whether the parentheses landed where you thought.

Ad

While you’re here — claim a crypto exchange bonus

More calculators

Frequently asked questions

Q. Which flavour of regex is this?

JavaScript’s. Most of it matches PCRE, but lookbehind support and some Unicode property escapes differ from Python or PHP.

Q. Why does my pattern only match once?

Without the global flag, matching stops at the first hit. Turn on g to find them all.

Q. How do I match a literal dot?

Escape it as \. — an unescaped dot means “any character except a line break”.