Regex tester

Build and debug a regular expression against your own sample text.

Regex tester: illustration of a code editor with brackets, a colour swatch and a settings gear
Regex tester is part of our free Developer tools collection. It works in your browser on phones, tablets and computers, with no sign-up.

How to use the regex tester

  1. Enter the pattern and flags (g, i, m, s, u).
  2. Paste your test text.
  3. See matches highlighted and each group listed.

When it's useful

  • Checking a validation pattern for phone numbers or emails
  • Extracting values from logs
  • Learning how regex groups work

Limits to know

  • Uses your browser's JavaScript regex engine; other languages (PCRE, Python) differ slightly.
  • Shows up to 500 matches. Patterns that take extremely long to run can freeze the page.

Your privacy

Everything is worked out in your browser. What you type isn't uploaded, saved or shared, and there's no sign-up.

What goes in and what comes out

Input:
A JavaScript regular expression, flags and sample text.
Output:
Highlighted matches with positions and capture groups.

Questions

Is my text sent anywhere?

No. Matching happens in your browser.

Related tools