Developer

JavaScript Regex Tester

Test JavaScript regular expressions live with highlighted matches, capture groups, positions, and flag support.

Also available in:EspañolPortuguêsFrançaisDeutschItalianoNederlandsPolski

2 matches

Contact hello@example.com or support@talkandtool.com for help.

#MatchIndexGroups
1hello@example.com8hello | example.com
2support@talkandtool.com29support | talkandtool.com

Everything runs in your browser. Your input is not uploaded to a server.

About the Regex Tester

Regular expressions are dense enough that trial and error is the only realistic way to build one. This tester evaluates your pattern against sample text on every keystroke, highlights each match in place, and lists capture groups and their positions so you can see exactly what the engine matched.

How to use the Regex Tester

  1. Type your pattern without the surrounding slashes.
  2. Set flags: g for all matches, i for case-insensitive, m for multiline.
  3. Paste sample text underneath.
  4. Review the highlighted matches and the capture groups for each one.

Frequently asked questions

Which regex flavour does this use?

JavaScript’s, via the native RegExp engine. Most syntax is shared with PCRE, but lookbehind support varies by browser and some PCRE features such as recursion do not exist here.

What is catastrophic backtracking?

A pattern with nested quantifiers like (a+)+ can take exponential time on non-matching input, freezing the page or hanging a server. Avoid nesting quantifiers around the same character class.

How do I match a literal dot?

Escape it as \. — an unescaped dot matches any character except a newline, which is why unanchored patterns often match far more than intended.

Should I parse HTML with a regex?

No. HTML is not a regular language, so nesting will eventually defeat any pattern. Use a DOM parser; regex is for flat, predictable text.