mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
Will need subsequent PRs fixing up test failures (due to deprecated methods moving around), but other than that everything should be straight-forward.
13 lines
368 B
Plaintext
13 lines
368 B
Plaintext
import python
|
|
import semmle.python.regex
|
|
|
|
predicate part(Regex r, int start, int end, string kind) {
|
|
r.lastItem(start, end) and kind = "last"
|
|
or
|
|
r.firstItem(start, end) and kind = "first"
|
|
}
|
|
|
|
from Regex r, int start, int end, string kind
|
|
where part(r, start, end, kind) and r.getLocation().getFile().getBaseName() = "test.py"
|
|
select r.getText(), kind, start, end
|