Free developer & data tool

Regular Expression Tester

Test browser JavaScript regex matches, captures and an optional replacement preview.

Uses your browser's JavaScript regular-expression engine. Text is processed locally in the browser.

Supported behavior

  • Test browser JavaScript regex matches, captures and an optional replacement preview.
  • Runs in an isolated worker terminated after 500 ms, with 2,000 pattern characters, 200,000 text/replacement characters and 1,000 matches maximum. No PCRE, lookbehind portability guarantee or code execution. Empty replacement means no preview, not deletion. Indices are UTF-16 offsets. Input limit: 200,000 characters per text input; regex and diff have additional limits described above.

How to use the Regular Expression Tester

  1. Enter the pattern without slash delimiters, sample text and optional replacement; toggle g, i, m, s or u.
  2. Review the result or error before copying. Shared output panels offer Copy; there is no file upload or download workflow.
  3. Tool input is processed locally without a tool API request. This does not establish site-wide analytics or logging policy.

Examples

Worked behavior

Pattern (?<id>\d+) against Order 123 returns 123 at UTF-16 index 6; replacement #$1 gives Order #123.

Limits and common mistakes

Runs in an isolated worker terminated after 500 ms, with 2,000 pattern characters, 200,000 text/replacement characters and 1,000 matches maximum. No PCRE, lookbehind portability guarantee or code execution. Empty replacement means no preview, not deletion. Indices are UTF-16 offsets. Input limit: 200,000 characters per text input; regex and diff have additional limits described above.

Frequently asked questions

Why can a valid pattern time out?

Backtracking can be expensive. Reduce text or simplify nested quantifiers; results depend on the browser JavaScript engine. Worker support is required.

Sources & methodology

Related tools

More developer & data tools