JavaScript Regex Tester

Test RegExp patterns against sample text with highlighting and timeout protection.

When to use this tool

  • Testing a regex against a representative block of sample text.
  • Debugging why a capture group is not firing in production.
  • Teaching regex basics — live highlighting of matches and groups.

How it works

  1. Paste the sample text.
  2. Enter the pattern and flags.
  3. Read the highlighted matches and capture group table.
  4. Iterate until the right matches are highlighted and no false positives appear.

Privacy: This tool runs entirely in your browser. Your input is not sent to our servers.

Advertisement

Frequently asked questions

Does it protect against catastrophic backtracking?

There is a timeout guard. If your regex hangs, the tester aborts and warns you before the tab freezes.

Which regex engine is used?

JavaScript's native `RegExp`, which matches the engine in Node.js, Cloudflare Workers, and the browser.

Can I test PCRE-specific features?

No. For PCRE or .NET regex features, use a language-specific tester. This tool targets the ECMAScript regex subset.