Files
codeql/python/ql/test/library-tests/regexparser/Consistency.ql
Rasmus Lerchedahl Petersen 34b054ff53 Python: Add consistency checks
2021-08-11 14:58:27 +02:00

16 lines
338 B
Plaintext

/**
* Flags regular expressions that are parsed ambigously
*/
import python
import semmle.python.RegexTreeView
from string str, int counter, Location loc
where
counter =
strictcount(RegExpTerm term |
term.getLocation() = loc and term.isRootTerm() and term.toString() = str
) and
counter > 1
select str, counter, loc