Skip to content

Regex Tester

Write a regular expression with its flags, paste some test text, and see every match highlighted with its position and captured groups. A fast way to build and debug patterns like email or phone validators.

What this means

A regular expression is a pattern language for finding text. The tester applies your pattern to each line of test text and lists every match with the character range where it was found.

How we calculate it

Formula

new RegExp(pattern, flags) tested over the text; each match records its index and the captured groups.

Worked example

Pattern [a-z]+@[a-z]+\.com against an email list:

  1. 1Enter the pattern and flags.
  2. 2Paste the text to test.
  3. 3Read the match list and positions.

Important assumptions

  • Patterns use JavaScript regex syntax, including flags like g, i and m.

Frequently asked questions

What do the flags do?

g matches globally, i is case-insensitive, m makes ^ and $ match line boundaries, s lets . match newlines.

Why does my pattern match nothing?

Check escaping — for a literal dot use \., and remember that + and * apply to the previous element.

Related tools