Files
codeql/python/ql/test/library-tests/regexparser/Consistency.ql

16 lines
345 B
Plaintext

/**
* Flags regular expressions that are parsed ambigously
*/
import python
import semmle.python.regexp.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