Free tools, no sign-up — everything runs in your browser.
ToolHub 1000Free online tools

How to Test a Regular Expression Before You Use It

A regex that looks right can still miss or over-match. This guide explains flags, match lists and the most common pattern mistakes.

What is the Regex Tester?

Regular expressions describe text patterns, and small mistakes in them are easy to miss. This tool runs your pattern with your chosen flags against your test text and lists each match, capped at 100 results. Invalid patterns are reported with the browser's error message instead of failing silently.

How to use it

  1. Type your pattern without surrounding slashes.
  2. Add flags such as g for all matches or i to ignore case.
  3. Paste test text, click Test regex, and review the match list.

Worked example

Testing the sample pattern against the sample text finds two matches: ada@example.com and bob@test.org.

What does the g flag do in a regex?

It makes the search global, returning every match in the text instead of stopping at the first one.

Frequently asked questions

Why do I see no matches?

Check the pattern, the flags and the test text: a missing flag such as g only affects how many matches are listed, while a wrong character class can stop matching entirely.

What does an invalid pattern error mean?

The pattern could not be compiled, usually because of an unbalanced bracket, parenthesis or a bad escape; the message names the problem.

Try the Regex Tester free · All guides