Skip to content

Test regular expressions

Test regular expressions against a text and see every match in real time with its position and capture groups, protected against patterns that could hang the tab.

Processed on your device. Nothing is sent to any server.

The pattern runs in a separate Web Worker with a time limit: if a pattern with excessive backtracking takes too long, it's stopped automatically instead of freezing the page.

Use cases

  • Debugging a regular expression before using it in code.
  • Extracting specific patterns from a text.
  • Validating a data format (email, phone, zip code).

How it works

  1. 1

    Type the pattern

    Enter the regular expression, without the leading and trailing / slashes.

  2. 2

    Add the test text

    Matches are calculated automatically.

Technical details

  • It uses JavaScript regular expression syntax (your browser's): named groups and lookbehind work, but not atomic groups or possessive quantifiers from other engines such as PCRE.
  • Matching is always global (the g flag is added if missing); you can add i (case-insensitive), m (multiline), s (dot matches line breaks) or u (Unicode).
  • Each match shows its position (starting at 0) and its groups. At most 10,000 matches are shown.
  • If the pattern takes longer than 800 ms, execution is stopped.

Frequently asked questions

What happens if my pattern is very slow?

Execution is automatically stopped after a time limit, protecting your browser from freezing due to catastrophic backtracking patterns.

← Developer