Skip to content

Commit 21e01b8

Browse files
committed
Add code example in CompiledRegex
Signed-off-by: jorgectf <[email protected]>
1 parent 8a80098 commit 21e01b8

File tree

1 file changed

+11
-0
lines changed
  • python/ql/src/experimental/semmle/python/frameworks

1 file changed

+11
-0
lines changed

python/ql/src/experimental/semmle/python/frameworks/Stdlib.qll

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,17 @@ private module Re {
4848
/**
4949
* A class to find `re` methods immediately executing a compiled expression by `re.compile`.
5050
*
51+
* Given the following example:
52+
*
53+
* ```py
54+
* pattern = re.compile(input)
55+
* input.match(s)
56+
* ```
57+
*
58+
* `patternCall` refers to `re.compile(input)`,
59+
* `regexNode` refers to `input` and
60+
* `this` will refer to `input.match(s)`
61+
*
5162
* See `RegexExecutionMethods`
5263
*
5364
* See https://docs.python.org/3/library/re.html#regular-expression-objects

0 commit comments

Comments
 (0)