Skip to main content

Regex Tester

Run a regular expression against test text and inspect matches and capture groups.

  • Runs in your browser
  • No sign-in needed

Pattern and test text

Enter the pattern without the surrounding slashes.

* marks required fields.

Matches

Enter a pattern and test text, then press [Run test] — the matches appear here.

How to use Regex Tester

When to use

Use to check how a regular expression for validating emails or phone numbers, or for extracting patterns from logs, matches real text before you put it into code.

What to input

Enter the pattern without surrounding slashes, set flags (g, i, m, s, u, y; default g), add test text, and press [Run test]. Each match is listed in a table with its index (counted from 0), matched text, and capture groups.

Usage example

e.g. Testing the pattern (\d{3})-(\d{4})-(\d{4}) with flag g against "Phone: 010-1234-5678, 010-9876-5432" finds 2 matches at indexes 7 and 22, and the first shows capture groups 010, 1234, 5678.

Things to check

It runs on the browser's JavaScript regex engine, so Python syntax like (?P<name>…) is an error - write named groups as (?<name>…). Without the g or y flag only the first match is shown, and at most 1,000 matches are displayed.

Related tools

  • Find and replace patterns in bulk text, with regex and case-sensitivity options.

    No sign-in neededRuns in your browser

  • Clean up line-based text in one pass: remove duplicates, drop empty lines, sort, add line numbers, and more.

    No sign-in neededRuns in your browser

Your input is processed only in this browser and is never sent to a server.