diff --git a/server/failregex.py b/server/failregex.py index 275380b9..9889ca67 100644 --- a/server/failregex.py +++ b/server/failregex.py @@ -40,9 +40,7 @@ class FailRegex(Regex): # avoid construction of invalid object. # @param value the regular expression - def __init__(self, value): - # Replace "" with default regular expression for host. - regex = value.replace("", "(?:::f{4,6}:)?(?P\S+)") + def __init__(self, regex): # Initializes the parent. Regex.__init__(self, regex) # Check for group "host" diff --git a/server/regex.py b/server/regex.py index d3d6eee4..22fb6797 100644 --- a/server/regex.py +++ b/server/regex.py @@ -42,6 +42,9 @@ class Regex: def __init__(self, regex): self._matchCache = None + # Perform shortcuts expansions. + # Replace "" with default regular expression for host. + regex = regex.replace("", "(?:::f{4,6}:)?(?P\S+)") if regex.lstrip() == '': raise RegexException("Cannot add empty regex") try: