@@ -31,12 +31,6 @@ def non_compliant(input):
31
31
re .match (r"[\"\".]" , input ) # Noncompliant
32
32
re .match (r"[\x{F600}-\x{F637}\x{F608}]" , input ) # Noncompliant
33
33
re .match (r"[\Qxx\E]" , input ) # Noncompliant
34
- re .match (r"[[a][a]]" , input ) # Noncompliant
35
- re .match (r"[[abc][b]]" , input ) # Noncompliant
36
- re .match (r"[[^a]b]" , input ) # Noncompliant
37
- re .match (r"[[^a]z]" , input ) # Noncompliant
38
- re .match (r"[a[^z]]" , input ) # Noncompliant
39
- re .match (r"[z[^a]]" , input ) # Noncompliant
40
34
re .match (r"[\s\Sx]" , input ) # Noncompliant
41
35
re .match (r"(?U)[\s\Sx]" , input ) # Noncompliant
42
36
re .match (r"[\w\d]" , input ) # Noncompliant
@@ -54,14 +48,15 @@ def non_compliant(input):
54
48
re .match (r"(?i)[äÄ]" , input ) # Noncompliant
55
49
re .match (r"(?i)[Ä-Üä]" , input ) # Noncompliant
56
50
re .match (r"(?i)[a-Öö]" , input ) # Noncompliant
51
+ re .match (r"[[^\s\S]x]" , input ) # Noncompliant
52
+ re .match (r"(?U)[[^\W]a]" , input ) # Noncompliant
57
53
58
54
59
55
def compliant (input ):
60
56
re .match (r"a-z\d" , input )
61
57
re .match (r"[0-9][0-9]?" , input )
62
58
re .match (r"[xX]" , input )
63
59
re .match (r"[\s\S]" , input )
64
- re .match (r"[[^\s\S]x]" , input )
65
60
re .match (r"(?U)[\s\S]" , input )
66
61
re .match (r"(?U)[\S\u0085\u2028\u2029]" , input )
67
62
re .match (r"[\d\D]" , input )
@@ -85,8 +80,6 @@ def compliant(input):
85
80
re .match (r"[z-a9-0]" , input ) # Illegal character class should not make the check explode
86
81
re .match (r"[aa" , input ) # Check should not run on syntactically invalid regexen
87
82
re .match (r"(?U)[\wä]" , input ) # False negative because we don't support Unicode characters in \w and \W
88
- re .match (r"(?U)[[^\W]a]" , input ) # False negative because once we negate a character class whose contents we don't
89
- # fully understand, we ignore it to avoid false positives
90
83
re .match (r"[[a-z&&b-e]c]" , input ) # FN because we don't support intersections
91
84
re .match (r"(?i)[A-_d-{]" , input ) # FN because we ignore case insensitivity unless both ends of the ranges are letters
92
85
re .match (r"(?i)[A-z_]" , input ) # FN because A-z gets misinterpreted as A-Za-z due to the way we handle case insensitivity
0 commit comments