- Fixed textToDNS method which generated wrong matches for "rhost=12-xyz...". Thanks to Tom Pike

git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@107 a942ae1a-1317-0410-a47c-b1dcaea8d605
0.6
Cyril Jaquier 2005-05-28 19:46:18 +00:00
parent a051e05cb4
commit 51f1dcee55
1 changed files with 2 additions and 1 deletions

View File

@ -37,8 +37,9 @@ def dnsToIp(dns):
def textToDns(text):
""" Search for possible DNS in an arbitrary text.
Thanks to Tom Pike.
"""
match = re.findall("\S*\.\w*\.\w*", text)
match = re.findall("(?:(?:\w|-)+\.){2,}\w+", text)
if match:
return match
else: