Processed in your browser

Regular Expression Tester

Run a pattern in a dedicated Worker so expensive expressions can be terminated. Results include match indexes and capture groups, with explicit handling for zero-length global matches.

Processed in your browser
0 / 200,000
Match results
Match highlights

Tool guide

What is Regular Expression Tester?

Regex Tester runs JavaScript RegExp in a separate Web Worker and reports matched text, indexes, captures, and highlights. If an expensive expression exceeds its time budget, the worker is terminated to reduce the risk of catastrophic backtracking freezing the interface. That protection does not prove the pattern is safe in another runtime. Common workflows include the following. Debug form-validation or log-extraction expressions. Inspect global matches, capture groups, and indexes. Identify test inputs that may trigger severe backtracking. The page also documents input boundaries, output behavior, and practical cautions so you can review the result before putting it into an application, configuration, test, or production workflow.

When to use it

  • Debug form-validation or log-extraction expressions.
  • Inspect global matches, capture groups, and indexes.
  • Identify test inputs that may trigger severe backtracking.

How to use it

  1. Enter a JavaScript regular expression and flags.
  2. Paste test text and run it in the isolated Worker.
  3. Review highlights, indexes, captures, truncation, or timeout messages.
  4. Load one of the realistic examples first to verify the selected options and processing direction before replacing it with your own data.
  5. Review the output, status message, and documented limits; copy, download, or continue only after the result matches your expectation.

Runnable examples

The “Example 1” and “Example 2” buttons load the matching inputs. They cover different structures, directions, or boundaries and can be run directly in the workspace.

Example 1

JSONLane 2026 released 20 tools
jsonlane 2030 tracks the long-term catalog
OtherSite 2026 does not match

Example 2

JSONLane 2048 branch=develop
JSONLane 4096 checks=unit,e2e,build
jsonlane version has no number

Input rules

  • Patterns use the JavaScript RegExp syntax supported by the current browser.
  • Flags must be valid and cannot be repeated.
  • Pattern and text length are constrained by page limits and timeout protection.
  • Text input is counted before processing and is limited to 200,000 characters on this page; file modes apply the separate file limit shown in the workspace.
  • A timeout limits execution time but cannot prove that a pattern is safe in another runtime.

Output rules

  • Results list each match's index, text, and capture groups.
  • Matched ranges are highlighted in a plain-text preview.
  • At most 1,000 matches are returned, with timeout or truncation clearly reported.
  • Output reflects only the current input, direction, and options; rerun after changing a mode or value instead of treating an earlier result as current.
  • Results are capped at 1,000 matches.

Limitations and cautions

  • A timeout limits execution time but cannot prove that a pattern is safe in another runtime.
  • Results are capped at 1,000 matches.
  • JavaScript RegExp features depend on the browser version.

How your data is handled

The expression and test text go only to a local Worker created by the page and are never uploaded.

FAQ

Which regex syntax is supported?

The tool uses the browser's JavaScript RegExp implementation.

What happens to a catastrophic pattern?

The Worker is terminated after the time budget, preventing the page UI thread from being trapped by that run.

How are empty matches handled?

Global zero-length matches advance by one Unicode position so the loop cannot become infinite.

Why can the same pattern behave differently in another language?

This page uses browser JavaScript RegExp; syntax, Unicode handling, flags, and backtracking differ across runtimes.

Can I continue after a timeout?

Yes. The expensive run occurs in a Worker that is terminated after 500 ms; edit the pattern and run a new Worker.

Why are results capped at 1,000 matches?

The cap prevents a global pattern from creating excessive output and DOM work, and the page reports when truncation occurs.

Updated: 2026-08-02