Regex Tester

Test JavaScript regular expressions with safe time and result limits.

Your input stays on this device and is processed in your browser.
Loading the tool…
STEP BY STEP

How to use Regex Tester

  1. Enter a JavaScript regular expression and select the flags you need.
  2. Add test text and run the expression in an isolated worker with a 750 ms limit.
  3. Review highlighted matches, indices, capture groups, and the capped result list.

Understand matches before shipping

Flags change the question the pattern is asking. Global scans for every match instead of stopping at the first, multiline redefines what the anchors mean, and the Unicode flag decides whether a property escape works at all. Testing without the flags the real code uses tests a different expression.

The pattern runs in a separate worker that is stopped after 750 milliseconds, and at most 200 matches come back. That limit is what keeps the page usable when an expression backtracks catastrophically — a pattern that times out here has told you something important about itself.

It has not told you it is safe. Time and result limits protect this page, and the same expression in a server request handler has neither. If a pattern only finishes here because it was cut off, it is a pattern to rewrite, not to deploy.

Frequently asked questions about Regex Tester

Which regex flavor does this tool use?

It uses the JavaScript RegExp implementation in your browser with g, i, m, s, u, and y flags.

Can a regular expression freeze the page?

The test runs in a separate worker that is terminated after 750 ms. This limits catastrophic backtracking without claiming that a costly pattern is safe for production.

Why are results limited?

The first 200 matches are enough for inspection while preventing a broad expression from creating an excessive amount of interface content.