Test regular expressions

Inspect matches, captures, locations and replacements with a time limit.

Processed only in this browser
Input and settings
Processing options

Input and results are processed in this browser, without saving them to a server, URL or persistent browser storage. Clipboard content and downloaded files may remain on your device.

How to use this tool

  1. Enter text and a pattern without surrounding / delimiters.
  2. Choose g/i/m/s/u flags and a replacement.
  3. Inspect highlighting, captures, line/column locations and replacements.

Capture a code and number

Input and settings
A-123 · pattern ([A-Z])-(\d+) · replacement $1:$2
Result
A:123 · captures A, 123

Without g, only the first match/replacement is processed.

Processing rules and reading the result

Uses the browser’s JavaScript RegExp syntax. Indices are UTF-16 offsets; line/column fields help locate matches. Empty matches advance to prevent endless enumeration.

Limits and checks before use

Limits: 200,000 input characters, 500 pattern characters, 1.5 seconds and 1,000 matches. Long matches/captures may be truncated for display. PCRE/Python regex behavior may differ.

Common questions

What do cancellation and timeout do?

They terminate the worker, stopping regex execution. Review complex patterns on smaller inputs.

Standards and references