Regex Tester

Run JavaScript regular-expression matches on demand. Inspect UTF-16 start indexes and captured groups with a bounded Worker execution time.

Loading tool module...

About this regex tester

The browser compiles the pattern with JavaScript RegExp and runs it after you press Test expression. Results show the matched text, its zero-based UTF-16 start index and captured groups. This is matching only: there is no replacement editor, syntax highlighter or pattern cheat sheet.

How this tool works

The browser compiles the pattern with JavaScript RegExp and runs it after you press Test expression. Results show the matched text, its zero-based UTF-16 start index and captured groups. This is matching only: there is no replacement editor, syntax highlighter or pattern cheat sheet.

  1. Enter cat in Pattern and g in Flags.
  2. Enter cat dog cat in Test text, then press Test expression.
  3. Check the two cat matches at indexes 0 and 8.

Worked example

Scenario: Find both occurrences of a word and verify their starting positions.

Sample input:

cat | g | cat dog cat

Processing: The browser compiles the pattern with JavaScript RegExp and runs it after you press Test expression. Results show the matched text, its zero-based UTF-16 start index and captured groups. This is matching only: there is no replacement editor, syntax highlighter or pattern cheat sheet.

Illustrative output:

0: cat 8: cat

Limits and verification

Patterns may contain up to 2,000 UTF-16 code units and test text up to 100,000. Worker startup has a separate 5-second limit; matching is stopped after a 350 ms execution budget. Browser scheduling can delay timeout delivery. At most 200 matches are shown, with a truncation notice only if another match exists. An empty pattern returns no matches. With u or v, an empty match advances by one Unicode code point.

Examples demonstrate an expected workflow; they do not prove every input or every branch of an external specification. Check important results with an independent source before using them for money, security, compliance, safety, or irreversible file changes.

Browser processing boundary

Tool input is processed by code running in the browser and is not intentionally sent to a CZOA processing API. The page can still request ordinary site assets, analytics, or advertising when those services are enabled. Browser extensions and managed-device software remain outside this tool's control.

Relevant references

These references govern or help explain the format, protocol, or calculation used here. Listing a reference does not claim certification or complete implementation of every optional feature.

Content owner: CZOA Tools · Review methodology

How to use it

  1. Enter cat in Pattern and g in Flags.
  2. Enter cat dog cat in Test text, then press Test expression.
  3. Check the two cat matches at indexes 0 and 8.

Frequently asked questions

How does Regex Tester execute patterns?+

It validates the flags, runs the pattern and test text in a disposable Web Worker, and terminates a started run after 350 ms. Worker startup has its own five-second limit.

What local example can I run?+

Enter pattern `[A-Z][a-z]+`, flags `g`, and test text `Ada`. The result lists one match, `Ada`, at index 0.

Which flags and limits apply?+

The flags may contain `d`, `g`, `i`, `m`, `s`, `u`, `v`, or `y`, without duplicates; `u` and `v` cannot be combined. Patterns above 2,000 characters and test text above 100,000 characters are rejected before execution.

Does a match prove the pattern is safe everywhere?+

No. The time limit protects this page run only. A global or sticky expression can return at most 200 matches, and another engine or input can behave differently.