We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be8f04a commit 8bc8342Copy full SHA for 8bc8342
python/ql/lib/semmle/python/regex.qll
@@ -140,7 +140,11 @@ string mode_from_node(DataFlow::Node node) { node = re_flag_tracker(result) }
140
141
/** A StrConst used as a regular expression */
142
abstract class RegexString extends Expr {
143
- RegexString() { (this instanceof Bytes or this instanceof Unicode) }
+ RegexString() {
144
+ (this instanceof Bytes or this instanceof Unicode) and
145
+ // is part of the user code
146
+ exists(this.getLocation().getFile().getRelativePath())
147
+ }
148
149
/**
150
* Helper predicate for `char_set_start(int start, int end)`.
0 commit comments