GET /v1/regexTest regex pattern against text
Validation Utils lf-validation-utils
Runs a search pattern against text and reports what it found and where. Tests a regex pattern against input text and returns matches with groups, positions, and match details.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
pattern | string | Yes | Regex pattern |
text | string | Yes | Text to test |
flags | string | No | Flags (g,i,m,s,u,y) |
Response Schema
success (boolean): Operation success
matches (array): Array of match objects
count (integer): Total matches found
cURL Example
curl 'https://lf-validation-utils.laminarforge.dev/v1/regex?pattern=%5Cd%2B&text=hello%20123&flags=g' -H 'Authorization: Bearer lf_YourApiKey'
Python Example
import requests
url = 'https://lf-validation-utils.laminarforge.dev/v1/regex'
headers = {'Authorization': 'Bearer lf_YourApiKey'}
params = {'pattern': '\\d+', 'text': 'hello 123', 'flags': 'g'}
response = requests.get(url, headers=headers, params=params)
print(response.json())