Regex-LE

v2.6.0
io.github.nolindnaidoo/regex-le Checked 11 hours ago Published 1 month ago

Extract 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.

ParameterTypeDescription
content *stringThe source text to scan.
filenamestringFilename used to infer the language when `format` is absent, e.g. "validate.py".
formatstringLanguage 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…
maxResultsintegerCap on returned patterns (default 500). meta.truncated reports whether any were dropped.