Docs

Regex Tester with Migration Patterns

Test a JavaScript regex with match, group, and timing details.

Overview

Tests a JS regex against a subject, returns matches with groups, named groups, and timing.

Features

  • All flags.
  • Captured and named groups.
  • Match count and timing.
  • 2s timeout.

Use cases

  • Validating an extraction pattern.
  • Debugging a regex.

API reference

POST /api/v1/tools/regex-test

Test a JavaScript regex against a subject string. Returns all matches (capped at 10,000) with groups, named groups, and timing.

Returns: The match count, an array of matches with captured and named groups, and the elapsed time in milliseconds.

Parameters

NameTypeRequiredDefaultDescription
pattern string Yes — The regex pattern (without surrounding slashes).
flags string No — Regex flags (e.g. "g", "i", "u"). Default empty.
input string Yes — The subject string to test against.

Example

curl -X POST https://data-migration-tools.com/api/v1/tools/regex-test \
  -H "Content-Type: application/json" \
  -d '{"pattern":"\\d+","flags":"g","input":"a1 b22 c333"}'

See the full API reference for all examples and error codes.