Regular Expression Test
regex_testRun a regular expression against sample strings, with a time cap. Send pattern, samples (up to 50 strings) and optionally mode (search, fullmatch or all), and the flags ignore_case, multiline, dotall, ascii. Get back, for each sample, whether it matched and every match with its start and end (counted in characters), the matched text and each capture group (number, name, span, text), or a clear error if the pattern is not valid. The flavor is Python (the 'regex' module in VERSION0 mode, a superset of Python re); the answer says if plain Python re would also accept the pattern. A pattern that backtracks for more than 0.5 s on a sample is reported as timed_out, not run forever. Answer fields: ok, verdict, result, rule, does_not, sources, observation, signature, verify. Errors: ok false with the reason (bad input, too large, hourly limit). Free. No model, no network, nothing you send is stored by the tool, and every answer is signed with LLPRO's key (check it at https://llpro.ai/regex-test). Not legal, tax or financial advice.
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 |
|---|---|---|---|
| mode | No | search (default): the first match anywhere in the sample; fullmatch: the whole sample must match; all: every non-overlapping match (up to 100 per sample). | |
| ascii | No | \w \d \s \b match ASCII only (flag a). Default false: they match Unicode letters and digits. | |
| dotall | No | . also matches a line break (flag s). Default false. | |
| pattern | Yes | The regular expression (Python / regex-module syntax), 1 to 500 characters. Do not put emails, Social Security, phone or card numbers in it. | |
| samples | Yes | Strings to test, 1 to 50, each up to 2000 characters (an empty string is allowed). Made-up test data only: emails, web addresses with a scheme, Social Security and phone shapes and card numbers are refused. | |
| multiline | No | ^ and $ also match at line breaks inside the sample (flag m). Default false. | |
| ignore_case | No | Case-insensitive matching (flag i). Default false. |