Skip to content

Commit 9eeacea

Browse files
authored
Merge pull request #4739 from RasmusWL/recrete-regex-fp
Python: Add regex FP with + for flags
2 parents 203bbdd + 014fbfa commit 9eeacea

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

python/ql/test/library-tests/regex/Mode.expected

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
| 50 | VERBOSE |
88
| 51 | UNICODE |
99
| 52 | UNICODE |
10-
| 64 | MULTILINE |
10+
| 56 | VERBOSE |
11+
| 68 | MULTILINE |

python/ql/test/library-tests/regex/test.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import re
2-
# 0123456789ABCDEF
2+
# 0123456789ABCDEF
33
re.compile(r'012345678')
44
re.compile(r'(\033|~{)')
55
re.compile(r'\A[+-]?\d+')
@@ -50,6 +50,10 @@
5050
re.compile("", flags=re.VERBOSE|re.IGNORECASE)
5151
re.search("", None, re.UNICODE)
5252
x = re.search("", flags=re.UNICODE)
53+
# using addition for flags was reported as FP in https://github.com/github/codeql/issues/4707
54+
re.compile("", re.VERBOSE+re.DOTALL) # TODO: Currently not recognized with Mode.ql
55+
# re.X is an alias for re.VERBOSE
56+
re.compile("", re.X)
5357

5458
#empty choice
5559
re.compile(r'|x')

0 commit comments

Comments
 (0)