Text & writing ● Local processing

Regular Expression Tester

Check a JavaScript regular expression against sample text.

Preparing tool…
Try a small example

Try a small example

Load the fictional example in a cleared form. Check the options, run the tool if needed, and compare the result below.

Find global matches using JavaScript regular-expression syntax, with optional case-insensitive, multiline, dotAll and Unicode flags. Matching runs in a short-lived worker so a slow pattern cannot freeze the page. Enter a pattern without surrounding slashes and paste sample text. Global matching is always on; choose i (ignore case), m (line anchors), s (dot matches newlines) or u (Unicode mode). The result shows up to 100 matches, capture groups and UTF-16 offsets. Patterns run in a worker with a time limit. Only the first 100 matches are shown. Matching has a short time limit and sample text is limited to 100,000 characters. Offsets are JavaScript UTF-16 indices; regex syntax differs across engines.

Regular expression (no surrounding slashes)

\b[A-Z][a-z]+\b

Sample text

Ada and Sam buy tea.

Expected output

Flags: gu
Matches: 2
1. "Ada" (UTF-16 index 0)
2. "Sam" (UTF-16 index 8)

The example is unavailable until the tool is ready.

Text is processed in your browser.

✓ Local processing✓ No account✓ Inputs processed here✓ Free

Quick answer

Find global matches using JavaScript regular-expression syntax, with optional case-insensitive, multiline, dotAll and Unicode flags. Matching runs in a short-lived worker so a slow pattern cannot freeze the page.

The page and its assets load from the site; this operation uses your entered values only in this browser and does not send them to a calculation endpoint.

How to use it

Enter a pattern without surrounding slashes and paste sample text. Global matching is always on; choose i (ignore case), m (line anchors), s (dot matches newlines) or u (Unicode mode). The result shows up to 100 matches, capture groups and UTF-16 offsets. Patterns run in a worker with a time limit.

Limits

Only the first 100 matches are shown. Matching has a short time limit and sample text is limited to 100,000 characters. Offsets are JavaScript UTF-16 indices; regex syntax differs across engines.

Frequently asked questions

Which flags can I use?

Global matching is always enabled. Optional flags are i for case-insensitive matching, m for line anchors, s for dot matching line breaks, and u for Unicode behavior.

Why did the pattern stop or show only some matches?

Patterns run in a separate worker with a 1.5-second limit, and only the first 100 matches are returned. Offsets count UTF-16 code units, as JavaScript string indices do.

Sources and references

These references document the cited standard or browser API; they do not validate the tool’s output.