Regex Tester

Test JavaScript patterns, inspect captures, and locate matches.

Text & Regex
Preparing your workspace…
Input
Output
Your result will appear here.

How to use

  1. Enter a pattern without / delimiters, choose flags, and add test text.
  2. Run the test manually. Inspect highlighted matches and the JSON report.
  3. Choose a match to locate or copy it, or download the report.

Testing JavaScript regular expressions

Try a JavaScript RegExp against local text without sending it to a server. The report includes matched text, zero-based UTF-16 positions, numbered captures, and named groups.

Use the flags supported by your browser. Global matching, multiline anchors, Unicode modes, sticky matching, and optional capture indices have their native JavaScript meanings.

Read matches and capture groups

Matches are highlighted in the input. Navigate through the reported matches to select their exact text, including original line endings. Unmatched optional captures are null in the JSON report. The example below shows values and offsets; the full report also includes captures.

Word matches and positions
Pattern and text
pattern = (?<word>\p{L}+)
flags = gu
text = Ada and Lin
Report excerpt
[{"value":"Ada","index":0,"end":3},
 {"value":"and","index":4,"end":7},
 {"value":"Lin","index":8,"end":11}]

The excerpt shows three match values and their [start, end) UTF-16 positions.

Flags and Unicode positions

The u and v flags are mutually exclusive. Without g only the first match is reported. Empty global matches advance by Unicode code point with u or v, and by UTF-16 code unit otherwise. Empty matches appear in the report without a colored text span.

Bounded local execution

Regex runs manually in a separate Worker, with a 2-second timeout and up to 500 reported matches. A truncated report says so explicitly. Pattern syntax errors retain the browser’s technical explanation. This is JavaScript syntax, not a PCRE, Python, or server-side regex emulator.

Processing limits

Up to 5 MiB of text, 100,000 logical lines, 20 MiB of output, and 10 seconds for text transformations. Regex tests allow 1 MiB of input, 4,096 pattern code units, 500 reported matches, and 2 seconds. Files must use UTF-8. All processing stays on your device.

?

Frequently asked questions

Is the regex evaluated on a server?

No. A browser Worker evaluates the pattern and can be terminated.

Why was my test stopped?

The 2-second limit was reached. Simplify the pattern or use a smaller text.

What do the positions count?

Zero-based UTF-16 code units, matching JavaScript string indexing.

Does an invalid pattern clear my text?

No. Your text stays in the input; the previous report is marked and export is disabled until a successful run.

Are all regex dialects supported?

No. Supported syntax and flags are those of the browser’s JavaScript engine.

Find your next tool

Language

Switch language? Your current work will be cleared. Copy or download it first.