RegEx Lab

Run regular expressions, inspect captures, and compare results across engines.

Pattern

Manage

Sample text

Manage
Loading the workbench…

Copy gives the current result JSON. Download includes the source, run settings, and observation details.

Run to see matches or other output for the selected operation.

Runtime limits and licenses

Runs use local browser workers with time and output limits. Python downloads its runtime from this site the first time it is used. Match and capture ranges include the start and exclude the end.

  • JavaScript uses the browser's RegExp engine and reports UTF-16 offsets. Split includes captured delimiters using native String.split.
  • PCRE2 reports UTF-8 byte offsets. The p flag enables Unicode properties. Interpreter stepping is available for PCRE2. Native structure inspection is partial.
  • Python re reports Unicode code-point offsets. Bytes mode encodes text as UTF-8, reports byte offsets and displays values in hex. A byte span that splits a Unicode character has no editor range.

PCRE2 license downloads for PCRE2 10.42, PCRE2 10.43, and PCRE2 10.49. Python runtime source and notices are available from Pyodide.

For certified engine evidence, see RegEx Compatibility Check. Lab results record local execution for the selected input and runtime.

Edit test case

Test expectation formats

Enter one JSON object per test. Choose the example for your operation.

{"kind":"boolean","value":false}
{"kind":"matches","count":2,"captures":[{"match":1,"key":"name","value":"alpha"}]}
{"kind":"matches","count":0}
{"kind":"replacement","value":"result"}
{"kind":"split","value":["first",null,"last"]}
{"kind":"error","value":"compile-rejection"}

Use a numbered or named capture key. A null capture value expects a defined group that did not participate.

Error categories include compile-rejection, runtime-error, resource-terminated, unsupported-operation, and infrastructure-failure.