From 81094674594d0fa118a83ff90b08b6ad4cd519df Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Sun, 22 Sep 2013 15:49:30 +1000 Subject: [PATCH] BF: use string replace rather than re.sub --- fail2ban-regex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fail2ban-regex b/fail2ban-regex index 6ac716ab..8e79f5e7 100755 --- a/fail2ban-regex +++ b/fail2ban-regex @@ -30,7 +30,7 @@ __author__ = "Cyril Jaquier, Yaroslav Halchenko" __copyright__ = "Copyright (c) 2004-2008 Cyril Jaquier, 2012-2013 Yaroslav Halchenko" __license__ = "GPL" -import getopt, sys, time, logging, os, urllib, re +import getopt, sys, time, logging, os, urllib # Inserts our own modules path first in the list # fix for bug #343821 @@ -52,7 +52,7 @@ from testcases.utils import FormatterWithTraceBack logSys = logging.getLogger("fail2ban") def debuggexURL(sample, regex): - q = urllib.urlencode({ 're': re.sub('', '(?&.ipv4)', regex), + q = urllib.urlencode({ 're': regex.replace('', '(?&.ipv4)'), 'str': sample, 'flavor': 'python' }) return 'http://www.debuggex.com/?' + q