Python: Add regex FP with + for flags

Notice that there is no new results for line 54

I also added a test for the short-named version of a flag, just since I didn't
see any of those already. That just works out of the box (due to points-to).
This commit is contained in:
Rasmus Wriedt Larsen
2020-11-27 14:55:23 +01:00
parent d3cded330e
commit 014fbfa86b
2 changed files with 7 additions and 2 deletions

View File

@@ -7,4 +7,5 @@
| 50 | VERBOSE |
| 51 | UNICODE |
| 52 | UNICODE |
| 64 | MULTILINE |
| 56 | VERBOSE |
| 68 | MULTILINE |

View File

@@ -1,5 +1,5 @@
import re
# 0123456789ABCDEF
# 0123456789ABCDEF
re.compile(r'012345678')
re.compile(r'(\033|~{)')
re.compile(r'\A[+-]?\d+')
@@ -50,6 +50,10 @@ re.compile("", re.VERBOSE|re.DOTALL)
re.compile("", flags=re.VERBOSE|re.IGNORECASE)
re.search("", None, re.UNICODE)
x = re.search("", flags=re.UNICODE)
# using addition for flags was reported as FP in https://github.com/github/codeql/issues/4707
re.compile("", re.VERBOSE+re.DOTALL) # TODO: Currently not recognized with Mode.ql
# re.X is an alias for re.VERBOSE
re.compile("", re.X)
#empty choice
re.compile(r'|x')