Regex Tester

Test ECMAScript regular expressions with flags, named groups and offsets. They run in a worker with a 1 s limit to stop catastrophic patterns.

Options

Input

Ctrl + Enter to run

Matches

Test regular expressions with your browser’s ECMAScript engine, the same one JavaScript uses. You get each match with its position (in UTF-16 code units), numbered and named groups, and the total count.

The expression runs in a separate worker with a 1-second limit: if a pattern causes catastrophic backtracking, it is stopped without freezing the page so you can fix it.

How to use it

  1. Type the pattern without slashes (for example \d+).
  2. Tick the flags you need.
  3. Paste the text and press Run.
  4. Review the matches and groups table.

Example

Example input
(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})

Pedidos: 2025-01-15, 2025-02-03 y 2024-12-31.
Result
2025-01-15
2025-02-03
2024-12-31

Limitations

  • ECMAScript syntax only: results may differ in PCRE, Java, Python or .NET.
  • Up to 10,000 matches (5000 on mobile); 2 KiB pattern and 256 KiB text at most.
  • Safari (JavaScriptCore) may internally give up on a pattern with excessive backtracking and report 0 matches instead of timing out: if a suspicious pattern does not match, check it in another browser.

FAQ

Why does my PHP regex behave differently?
PCRE has features ECMAScript lacks (inline modifiers, recursion, possessive quantifiers). This tool does not promise compatibility with other engines.
What about empty matches?
They are recorded and the engine advances one character (a full code point with u or v) to avoid an infinite loop.

Related tools

References