Python: Regexp: Handle repetions {n} (with no ,)

This commit is contained in:
Rasmus Lerchedahl Petersen
2020-05-18 14:44:11 +02:00
parent 8d41ce1630
commit b56545b236
5 changed files with 12 additions and 5 deletions

View File

@@ -472,8 +472,12 @@ abstract class RegexString extends Expr {
this.getChar(endin) = "}" and
end > start and
exists(string multiples | multiples = this.getText().substring(start + 1, endin) |
multiples.regexpMatch("0+") and maybe_empty = true
or
multiples.regexpMatch("0*,[0-9]*") and maybe_empty = true
or
multiples.regexpMatch("0*[1-9][0-9]*") and maybe_empty = false
or
multiples.regexpMatch("0*[1-9][0-9]*,[0-9]*") and maybe_empty = false
) and
not exists(int mid |