Generate a regex pattern based on a natural language description using AI.
| Field | Type | Description |
|---|---|---|
description | str | Natural language description of what to match (e.g., “phone numbers in format (XXX) XXX-XXXX”). |
examples | List[str] | Optional. List of example strings that should match the pattern. |
{ "regex": str, "explanation": str }{
"description": "phone numbers in format (XXX) XXX-XXXX",
"examples": [
"(123) 456-7890",
"(555) 123-4567"
]
}
{
"regex": "\(\d{3}\) \d{3}-\d{4}",
"explanation": "Matches phone numbers in the format (XXX) XXX-XXXX where X is a digit"
}