AI Assistance
Suggest Patterns
Generate a regex pattern based on a natural language description using AI.
Request Body
| 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. |
Response
- 200: Regex pattern generated successfully
- Returns:
{ "regex": str }
- Returns:
- 400: Bad Request (e.g., invalid request data)
- 500: Internal Server Error
Example
{
"description": "phone numbers in format (XXX) XXX-XXXX",
"examples": [
"(123) 456-7890",
"(555) 123-4567"
]
}
Example Response
{
"regex": "\(\d{3}\) \d{3}-\d{4}",
}
POST
Python
Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Body
application/json
Python
