CodeQL library for Java
codeql/java-all 0.4.0-dev (changelog, source)
Search

Predicate usedAsRegex

Holds if regex is used as a regex, with the mode mode (if known). If regex mode is not known, mode will be "None".

As an optimisation, only regexes containing an infinite repitition quatifier (+, *, or {x,}) and therefore may be relevant for ReDoS queries are considered.

Import path

import semmle.code.java.regex.RegexFlowConfigs
predicate usedAsRegex(StringLiteral regex, string mode, boolean match_full_string)