Regex-LE
v2.6.0Extract regular expressions from code, each with a ReDoS safety verdict.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
extract_patterns
Extract every regular expression from source code — JavaScript and TypeScript literals and RegExp constructors, and the call sites Python, Rust, Go, Java, Ruby, PHP and C# write a pattern at — with its flags, 1-based position, and a ReDoS verdict saying whether the pattern can be driven into catastrophic backtracking. Duplicate pattern-and-flags pairs are reported once, at first occurrence: the output is a pattern list, not an occurrence list.
| Parameter | Type | Description |
|---|---|---|
content * | string | The source text to scan. |
filename | string | Filename used to infer the language when `format` is absent, e.g. "validate.py". |
format | string | Language of the document, so only its own spellings are looked for: javascript, typescript, python, rust, go, java, ruby, php, csharp. Common extensions and aliases are accepted. Optional — with no… |
maxResults | integer | Cap on returned patterns (default 500). meta.truncated reports whether any were dropped. |