Regex Tester

Test a regular expression on sample text and see each match and group.

Regex Tester

Paste text or open a file to see the result.

What it does

Runs a regular expression on your sample text and lists each match with its line, column and capture groups. Writing a pattern by trial and error inside code is slow, so testing it here first saves time. You see how many matches there are and what each group holds.

How to use the Regex Tester

  1. Type the pattern in Pattern without slashes, for example \d{3}-\d{4}.
  2. Put the flags in Flags: g for all matches, i to ignore case, m for multi-line.
  3. Paste the sample text into the Input box.
  4. Read each match with its line, column and groups, then adjust the pattern.

Related tools

More in Validators

Regex Tester questions

How do I use the Regex Tester?

Paste the text into the Input box or open a file, set the options, then copy or download the result.