File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
ql/src/codeql_ql/performance Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -45,10 +45,10 @@ class RegexpMatchPredicate extends BuiltinPredicate {
4545predicate canUseMatchInsteadOfRegexpMatch ( Call c , string matchesStr ) {
4646 c .getTarget ( ) instanceof RegexpMatchPredicate and
4747 exists ( string raw | raw = c .getArgument ( 0 ) .( String ) .getValue ( ) |
48- matchesStr = "%" + raw .regexpCapture ( "^\\.\\*(\\w +)$" , _)
48+ matchesStr = "%" + raw .regexpCapture ( "^\\.\\*([a-zA-Z\\d\\s-] +)$" , _)
4949 or
50- matchesStr = raw .regexpCapture ( "^(\\w +)\\.\\*$" , _) + "%"
50+ matchesStr = raw .regexpCapture ( "^([a-zA-Z\\d\\s-] +)\\.\\*$" , _) + "%"
5151 or
52- matchesStr = "%" + raw .regexpCapture ( "^\\.\\*(\\w +)\\.\\*$" , _) + "%"
52+ matchesStr = "%" + raw .regexpCapture ( "^\\.\\*([a-zA-Z\\d\\s-] +)\\.\\*$" , _) + "%"
5353 )
5454}
You can’t perform that action at this time.
0 commit comments