This is closely related to issue #83. The regex at line 243 in init.py is buggy.
The regex in question is
"^[AS]|[as]|[aS]|[As]][0-9]*(\.)?[0-9]+"
There's 2 issues:
- Bug A: Extra ] (an unmatched closing bracket) in
[As]]
- Bug B: The Alternation Is Broken. Because | has low precedence, this means:
(^[AS]) OR ([as]) OR ([aS]) OR ([As]])
Which means:
^[AS] is anchored
The other alternatives are NOT anchored
The numeric part only applies to the last branch
So the regex does not enforce:
AS123
AS1.234
correctly.
Suggestion is to use
pattern = re.compile(r"(?i)^as\d+(\.\d+)?$")
Or simply merge the PR that has a more complete fix
This is closely related to issue #83. The regex at line 243 in init.py is buggy.
The regex in question is
There's 2 issues:
[As]](^[AS]) OR ([as]) OR ([aS]) OR ([As]])
Which means:
^[AS] is anchored
The other alternatives are NOT anchored
The numeric part only applies to the last branch
So the regex does not enforce:
AS123
AS1.234
correctly.
Suggestion is to use
Or simply merge the PR that has a more complete fix