Skip to content
FileConvertify
Tools

Regex Tester

Test JavaScript regular expressions with highlighted matches and capture groups. Your input stays in your browser.

  • Free, no sign-up
  • Text stays in your browser
  • Local processing / no upload

Limit: 500,000 character units per input. Oversized pastes are rejected. Drafts stay in this page and are not saved.

Tool options

g: all matches; i: ignore case; m: multiline anchors; s: dot matches newlines; u: Unicode; y: sticky; d: capture indices; v: Unicode sets. Support depends on your browser.

Step by step

How to use Regex Tester

  1. Step 1: Paste sample text into Input and a bare pattern without slash delimiters into Pattern. Enter flags separately; g collects all matches.

  2. Step 2: Select Test regex. Inspect highlights, zero-based ranges and numbered or named captures. A two-second evaluation limit stops expensive patterns.

  3. Step 3: Revise the pattern if it times out. Copy or download match details, checking any truncation notice; results follow JavaScript regex rules.

Example to try

Load example with the default named-letter pattern and g flag. A12 and B34 match; each has a letter capture and a digit capture, with the letter also available as a named group.

Test a JavaScript pattern with explicit flags

Enter a bare expression without surrounding slash delimiters and choose flags in the separate field. The default example captures the letter and number parts of order identifiers. Add g to inspect all matches rather than only the first. The results show zero-based UTF-16 start and end positions, full-match text, numbered captures and named captures. Unmatched optional captures are labeled explicitly.

Understand flags and browser support

The flag help explains global matching, ignore case, multiline anchors, dot-all, Unicode, sticky matching, capture indices and Unicode sets. Available syntax depends on the browser JavaScript engine; invalid, duplicated or incompatible flags produce a syntax error. Unicode and Unicode-set modes cannot be combined. This is a JavaScript tester and does not promise the same behavior as Python, PHP or a database regex engine.

Output limits and local processing

At most 1,000 matches are displayed, and match or capture text in the report is abbreviated after 500 characters. Highlights use the corresponding input ranges, while zero-width matches appear in the detail list. Pattern text is limited to 10,000 character units. Pasted text and expressions are processed locally; the worker evaluates only the regular expression and never executes them as JavaScript source.

Inputs and results are held only in this page's memory. Developer inputs accept up to 500,000 character units each. Oversized pastes are rejected while preserving the previous input. Generated output is limited to 5,000,000 character units. No sign-up is needed. Copy and download actions are explicit; the tool does not upload your drafts or save them for a later visit.

Frequently asked questions

Why does only one match appear?
Add the g flag to collect all non-overlapping matches. Without it, the tester shows the first match, matching ordinary JavaScript behavior.
Can a regex freeze the page?
Evaluation runs in a separate worker that is terminated after two seconds. A timeout means you should simplify the pattern or shorten the input.
How are empty matches handled?
They are reported with positions, then evaluation advances safely. In Unicode mode it advances by a full code point to avoid getting stuck inside a surrogate pair.
Are regex explanations generated by AI?
No. This tool provides matches, capture groups, flag help and browser syntax errors. It does not generate a token-by-token or AI explanation.