Regex Tester

Test JavaScript regular expressions with live match and capture group highlighting.

Runs in your browser Free

Test your regex live

Regular expressions are powerful for email validation, log parsing, text cleanup and data extraction, but hard to write. The Regex Tester highlights every match and capture group in your test text as you type the pattern.

Features

  • g, i, m, s, u and y flags
  • The position of every match and its capture groups (numbered and named)
  • Clear error messages for invalid patterns

Freeze protection

Some badly written patterns (catastrophic backtracking) can lock up a browser. Here, matching runs in a background worker with a time limit, so excessively slow patterns are stopped safely. Your test text is never sent anywhere.

How to use Regex Tester

  1. Write your regex pattern.
  2. Choose the flags you need.
  3. Paste test text; matches are highlighted live.
  4. Inspect the capture groups and refine the pattern.

Why use this tool?

Speeds up trial and error and makes sure the pattern works before it goes into your code.

FAQ

Can a bad pattern freeze the page?

No. Matching runs in a background worker with a time limit; overly slow patterns are stopped safely.

Which regex flavour is used?

JavaScript (ECMAScript) regular expressions. Most syntax is shared with PCRE, Python and .NET, but there are some differences.

How do I match accented letters?

Turn on the u flag and use Unicode property classes such as \p{L}, or write character sets like [éèêë].

Related tools