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

Predicate regexMatchedAgainst

Holds if the string literal regex is a regular expression that is matched against the expression str.

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 regexMatchedAgainst ( StringLiteral regex , Expr str )