Regex tester & visual builder

Test regex, build patterns and filter lines.

Enable JavaScript to use this interactive tool. Paste input, choose options, then copy or download the result, or save it to your notebook.

Example and common questions

Choose Test my regex to inspect a pattern you already have, or Build a regex to select fields from a sample line. JavaScript, PCRE2 and RE2JS run locally. Extract matches, keep or exclude matching lines, and check examples with expected outcomes.

How to test or build a regex

  1. Choose a workflow and local engine. Paste your pattern and test text, or select sample fields in Build a regex.
  2. Select sample fields and capture options, or drag across colored ranges to join fields. For keyboard joining, select a field and press Shift+Enter on another range. Your regex appears immediately and matches update automatically. Copy the pattern directly, or choose whether to extract matches or filter complete lines.
  3. Inspect highlighted matches and captures, and add examples that should or should not match. Check the flavor guide before using the pattern in another runtime.

Capture a log level, request ID, and status

Regex pattern
(?<level>INFO|WARN|ERROR) request=(?<requestId>req \d+) status=(?<status>\d{3})
Regex flags
gm
Maximum matches
100
Input
2026-10-21 INFO request=req-42 status=200
First match — excerpt
{
  "from": 11,
  "to": 41,
  "match": "INFO request=req-42 status=200",
  "groups": [
    "INFO",
    "req-42",
    "200"
  ],
  "namedGroups": {
    "level": "INFO",
    "requestId": "req-42",
    "status": "200"
  }
}
Which regex syntax is supported?

JavaScript uses your browser’s RegExp; PCRE2 10.48 runs in WebAssembly; RE2 syntax runs with RE2JS 2.9. The flavor guide covers 14 common profiles and marks reference-only profiles Not executed here. There is no fixed total of regex flavors.

What do positions and groups mean?

Groups contain captured text. Positions are UTF-16 offsets into the original input, with an inclusive start and exclusive end.

Why can results stop early?

Match and result budgets bound the output, and processing has a worker timeout. See Details and limits. Simplify a pattern or reduce the input when processing stops.

Common errors and limitations

Check invalid patterns, unsupported or duplicate flags, and timeouts. Your input remains available for correction; a timeout does not mean the pattern has no matches.