File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
python/ql/lib/semmle/python Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -773,15 +773,18 @@ abstract class RegexString extends Expr {
773
773
* string is empty.
774
774
*/
775
775
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
780
782
lower = inner and
781
783
upper = lower
782
784
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
785
788
lower = inner .prefix ( commaIndex ) and
786
789
upper = inner .suffix ( commaIndex + 1 )
787
790
)
You can’t perform that action at this time.
0 commit comments