* 'master' of https://github.com/sebres/fail2ban:
  invalid date recognition, irregular because of sorting template list, now via setRegex
  invalid date recognition, irregular because of sorting template list (sometimes not reproducible by fail2ban-regex, cause will be not sorted)
pull/115/merge
Yaroslav Halchenko 12 years ago
commit 7813340e1c

@ -50,8 +50,11 @@ class DateTemplate:
def getName(self): def getName(self):
return self.__name return self.__name
def setRegex(self, regex): def setRegex(self, regex, wordBegin = True):
self.__regex = regex.strip() regex = regex.strip()
if (wordBegin and not re.search(r'^\^', regex)):
regex = r'\b' + regex
self.__regex = regex
self.__cRegex = re.compile(regex) self.__cRegex = re.compile(regex)
def getRegex(self): def getRegex(self):

Loading…
Cancel
Save