Regex Test
regex_testTest a regular expression against sample strings. FREE.
Typical input {"pattern": "v(\d+)", "samples": ["v12", "beta"]} returns {"pattern": ..., "results": [{"sample": "v12", "match": true, "matched_text": "v12", "groups": ["12"]}, {"sample": "beta", "match": false, ...}], "match_count": 1}.
Use to confirm a pattern matches what you expect before shipping it. Not for validating JSON (json_validate). The pattern is compiled and run in a short-lived, CPU-capped child process, so a pattern that backtracks catastrophically is stopped instead of stalling the server. Errors: on invalid, missing, or malformed input this tool never raises a protocol error; it returns {"error": ""} (for example {"error": "a sample is too long (max 10000 characters); shorten it and retry"}). Every call is read-only and idempotent, so after correcting the input it is always safe to retry.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"pattern": "<pattern>",
"samples": "<samples>"
},
"name": "regex_test"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | Yes | A Python-flavor regular expression as a string, e.g. "v(\\d+)". | |
| samples | Yes | Strings to test the pattern against; only the first 50 are evaluated. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||