Merge pull request #72 from L0ric0/master

fix start and end positions of match in RegexArgument
This commit is contained in:
Tulir Asokan 2019-10-23 14:46:55 +03:00 committed by GitHub
commit 6f37f914e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -284,8 +284,8 @@ class RegexArgument(Argument):
val = val.split(" ")[0] val = val.split(" ")[0]
match = self.regex.match(val) match = self.regex.match(val)
if match: if match:
return (orig_val[:match.pos] + orig_val[match.endpos:], return (orig_val[:match.start()] + orig_val[match.end():],
match.groups() or val[match.pos:match.endpos]) match.groups() or val[match.start():match.end()])
return orig_val, None return orig_val, None