Fix "span" regex
This disallows matching "0-11-2" and "1," for example. It also avoids an exponential backtracking issue which could make this regex very slow.
This commit is contained in:
parent
a7483313d9
commit
28a8959854
1 changed files with 1 additions and 1 deletions
|
@ -486,7 +486,7 @@ def actualtype(a):
|
|||
atype = "percentage"
|
||||
elif re.match(r"-?[0-9]+,-?[0-9]+\Z", a):
|
||||
atype = "position"
|
||||
elif re.match(r"([0-9]+\-[0-9]+,?|[0-9]+,?)+\Z", a):
|
||||
elif re.match(r"(([0-9]+-)?[0-9]+,)*([0-9]+-)?[0-9]+\Z", a):
|
||||
atype = "span"
|
||||
elif a in ("melee", "ranged"):
|
||||
atype = "range"
|
||||
|
|
Loading…
Add table
Reference in a new issue