API CatalogRegex Generator

Regex Generator API

Generate a regular expression from a plain English description. Use it in developer tools, form builders, validation workflows, and automation systems.

Endpoint

POST /v1/dev/regex/generate

Request body

FieldTypeRequiredDescription
descriptionstringYesPlain English description of the desired regex.
flavorstringNoRegex flavor such as pcre, python, javascript, go, or re2. Defaults to pcre.

Example request

curl --request POST \
  --url https://apimask-developer-utilities-api.p.rapidapi.com/v1/dev/regex/generate \
  --header "Content-Type: application/json" \
  --header "X-RapidAPI-Key: $RAPIDAPI_KEY" \
  --header "X-RapidAPI-Host: apimask-developer-utilities-api.p.rapidapi.com" \
  --data '{"description":"Match a valid email address","flavor":"python"}'

Example response

{
  "success": true,
  "data": {
    "pattern": "^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}$",
    "explanation": "Matches a common email address structure.",
    "test_cases": [
      { "string": "hello@example.com", "should_match": true },
      { "string": "not-an-email", "should_match": false }
    ]
  },
  "error": null,
  "meta": {}
}

Response fields

FieldTypeDescription
patternstringGenerated regular expression.
explanationstringPlain English explanation.
test_casesarraySuggested strings and expected match results.