From 0d9c7c1bd2b9c9ac6637ab281622f107daf3c4ac Mon Sep 17 00:00:00 2001 From: Romain Goffe Date: Wed, 11 Jan 2012 18:13:05 +0100 Subject: [PATCH] Utils: correct regexp for removing spaces before punctuation symbols --- utils/rules.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/rules.py b/utils/rules.py index 0a7f8847..991fd3ba 100755 --- a/utils/rules.py +++ b/utils/rules.py @@ -139,13 +139,13 @@ for filename in songfiles: elif (re.compile("selectlanguage{english}").search(data)): #print "english song" #ensure no spaces before symbols ? ! ; : ) - data = re.sub("(?P\S)(?P[!?;:\)])","\g\g", data) + data = re.sub("(?P\S)\s(?P[!?;:\)])","\g\g", data) #ensure no spaces after symbols ( data = re.sub("(?P[\(])\s(?P\S)","\g\g", data) elif (re.compile("selectlanguage{spanish}").search(data)): #print "spanish song" #ensure no spaces before symbols ? ! ; : ) - data = re.sub("(?P\S)(?P[!?;:\)])","\g\g", data) + data = re.sub("(?P\S)\s(?P[!?;:\)])","\g\g", data) #ensure no spaces after symbols ¿ ¡ ( data = re.sub("(?P[¿¡\(])\s(?P\S)","\g\g", data) elif (re.compile("selectlanguage{portuguese}").search(data)):