File tree Expand file tree Collapse file tree
python/ql/lib/semmle/python Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -773,15 +773,18 @@ abstract class RegexString extends Expr {
773773 * string is empty.
774774 */
775775 predicate multiples ( int start , int end , string lower , string upper ) {
776- this .getChar ( start ) = "{" and
777- this .getChar ( end - 1 ) = "}" and
778- exists ( string inner | inner = this .getText ( ) .substring ( start + 1 , end - 1 ) |
779- inner .regexpMatch ( "[0-9]+" ) and
776+ exists ( string text , string match , string inner |
777+ text = this .getText ( ) and
778+ end = start + match .length ( ) and
779+ inner = match .substring ( 1 , match .length ( ) - 1 )
780+ |
781+ match = text .regexpFind ( "\\{[0-9]+\\}" , _, start ) and
780782 lower = inner and
781783 upper = lower
782784 or
783- inner .regexpMatch ( "[0-9]*,[0-9]*" ) and
784- exists ( int commaIndex | commaIndex = inner .indexOf ( "," ) |
785+ match = text .regexpFind ( "\\{[0-9]*,[0-9]*\\}" , _, start ) and
786+ exists ( int commaIndex |
787+ commaIndex = inner .indexOf ( "," ) and
785788 lower = inner .prefix ( commaIndex ) and
786789 upper = inner .suffix ( commaIndex + 1 )
787790 )
You can’t perform that action at this time.
0 commit comments