Skip to content

Regex tester and explainer

InspectExperimentalLimited support. Verify anything critical.

A regular-expression tester evaluates a pattern against sample text and reports each match, its position, and captured groups. This implementation runs the expression inside a dedicated browser Worker with a hard cancellation deadline, so an expensive pattern cannot indefinitely freeze the interface. A compact explainer identifies common anchors, character classes, groups, and repetition tokens without pretending to provide a formal proof of what every possible JavaScript expression means.

Skip to the tool

This tool processes the values or files you choose on your device. They are not uploaded.

Output

Limits

  • Patterns are limited to 500 characters
  • samples to 100000 characters
  • and execution to 250 ms.

Warnings

  • A successful sample does not prove a pattern is safe for untrusted production input.

Steps

Enter the pattern and flags

Type a JavaScript regular expression and optional flags such as g or i in the dedicated fields.

Paste sample text

Provide the haystack you want to test — keep it under the sample size limit.

Run and read matches

Inspect match indexes, captured groups, and the plain-language token cues in the explainer panel.

How to use Regex tester and explainer

Read the result, not just the colour

Matches are returned as structured rows with indexes and captured groups. Example: with pattern Order ([A-Z]-\d+) and sample Order A-104 shipped, expect a match whose first capture is A-104.

Production caution

The timeout protects this page. It does not certify the same expression under different input lengths or another regular-expression engine.

How it works

  1. Enter what you haveType or pick your regular expression, sample text. Nothing is submitted anywhere.
  2. It runs in this tabThe calculation happens on your device, using your browser's own data.
  3. Take the resultRead the matches, captured groups, syntax explanation, then copy or download.

Worked example

Given: Order A-104 shipped

Result: Match Order A-104 with capture group A-104 when the pattern is Order ([A-Z]-\d+) and flags gi

Uses the browser JavaScript RegExp engine inside a cancellable local Worker.

Basis
independent
Licence
MIT
Last reviewed

Frequently asked questions

Why can a regex time out?

Some nested repetitions trigger catastrophic backtracking. The Worker is terminated when it exceeds the local time budget.

Does a green match mean the pattern is production-safe?

No. A successful sample only proves behaviour on that text. ReDoS risk and engine differences still need separate review.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close