Skip to content

Commit e962a7c

Browse files
erik-kroghyoff
andauthored
Update python/ql/src/semmle/python/RegexTreeView.qll
Co-authored-by: yoff <[email protected]>
1 parent 6da1007 commit e962a7c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

python/ql/src/semmle/python/RegexTreeView.qll

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -839,9 +839,11 @@ class RegExpSubPattern extends RegExpZeroWidthMatch {
839839

840840
/** Gets the lookahead term. */
841841
RegExpTerm getOperand() {
842-
result.getRegex() = re and
843-
result.getStart() = start + 3 and
844-
result.getEnd() = end - 1
842+
exists(int in_start, int in_end | re.groupContents(start, end, in_start, in_end) |
843+
result.getRegex() = re and
844+
result.getStart() = in_start and
845+
result.getEnd() = in_end
846+
)
845847
}
846848
}
847849

0 commit comments

Comments
 (0)