Toolbox / Regular expression lab Runs in your browser中文
Development

Regular expression lab

Inspect matches and captures, generate verified examples, and draw an SVG syntax diagram.

Ctrl / ⌘ + Enter Run

Ready when you are

Less switching. More focus.Functional build · Validation in progress

Using this tool

Inspect JavaScript regex matches, offsets, and capture groups to debug patterns.

Actions: Process

Example

In the dedicated test field enter a12 b3, use pattern \d+ without slashes and flag g, then Find matches.

Example action and settings

Action: Match
Pattern: \d+
Flags: g
Count: 5

Input / action

a12 b3

Result / expected behavior

{
  "matches": [
    {
      "match": "12",
      "index": 1,
      "end": 3,
      "captures": [],
      "groups": {}
    },
    {
      "match": "3",
      "index": 5,
      "end": 6,
      "captures": [],
      "groups": {}
    }
  ],
  "count": 2,
  "truncated": false
}

Scope and limitations

  • Uses JavaScript regex semantics; browser worker computation stops after 1.5 seconds and returns at most 10,000 matches.

Common mistakes

  • Do not enter /pattern/g delimiters; without g only the first match is returned, and offsets use UTF-16 units.

Related tools

Regex syntax reference Text diff

Privacy and browser support

Input is processed in this browser. Do not use real keys or active sensitive credentials as demonstration data. Device features require browser support and your permission.