Python: re, handle \Z

This commit is contained in:
Rasmus Lerchedahl Petersen
2020-05-26 11:42:21 +02:00
parent f1efdee194
commit 6b168de7fc
4 changed files with 6 additions and 9 deletions

View File

@@ -624,7 +624,8 @@ abstract class RegexString extends Expr {
exists(int y | this.lastPart(start, y) |
this.emptyMatchAtEndGroup(end, y) or
this.qualifiedItem(end, y, true) or
this.specialCharacter(end, y, "$")
this.specialCharacter(end, y, "$") or
y = end+2 and this.escapingChar(end) and this.getChar(end+1) = "Z"
)
or
exists(int x |

View File

@@ -1,3 +1,3 @@
| test.py:44:12:44:18 | Str | This regular expression includes duplicate character 'A' in a set of characters. |
| test.py:45:12:45:19 | Str | This regular expression includes duplicate character '0' in a set of characters. |
| test.py:46:12:46:21 | Str | This regular expression includes duplicate character '-' in a set of characters. |
| test.py:45:12:45:18 | Str | This regular expression includes duplicate character 'A' in a set of characters. |
| test.py:46:12:46:19 | Str | This regular expression includes duplicate character '0' in a set of characters. |
| test.py:47:12:47:21 | Str | This regular expression includes duplicate character '-' in a set of characters. |

View File

@@ -1,4 +1,4 @@
| test.py:4:12:4:19 | Str | This regular expression includes an unmatchable caret at offset 1. |
| test.py:5:12:5:23 | Str | This regular expression includes an unmatchable caret at offset 5. |
| test.py:6:12:6:21 | Str | This regular expression includes an unmatchable caret at offset 2. |
| test.py:77:12:77:27 | Str | This regular expression includes an unmatchable caret at offset 8. |
| test.py:78:12:78:27 | Str | This regular expression includes an unmatchable caret at offset 8. |

View File

@@ -1,8 +1,4 @@
| test.py:29:12:29:19 | Str | This regular expression includes an unmatchable dollar at offset 3. |
| test.py:30:12:30:23 | Str | This regular expression includes an unmatchable dollar at offset 3. |
| test.py:31:12:31:20 | Str | This regular expression includes an unmatchable dollar at offset 2. |
| test.py:41:10:41:27 | Str | This regular expression includes an unmatchable dollar at offset 5. |
| test.py:41:10:41:27 | Str | This regular expression includes an unmatchable dollar at offset 11. |
| test.py:41:10:41:27 | Str | This regular expression includes an unmatchable dollar at offset 13. |
| test.py:42:10:42:25 | Str | This regular expression includes an unmatchable dollar at offset 3. |
| test.py:79:12:79:26 | Str | This regular expression includes an unmatchable dollar at offset 3. |