From: hernani Date: Tue, 1 Jun 2010 21:34:30 +0000 (+0000) Subject: Improved the regular expression that removes bad characters from search queries. X-Git-Tag: live~779 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/36d8ccc491b157c00e38a8f3192d47b7ead19964?ds=inline;hp=5cced8510af03eec1438cfefcf9f44e2e7a49087 Improved the regular expression that removes bad characters from search queries. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@353 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum_modules/pgfulltext/handlers.py b/forum_modules/pgfulltext/handlers.py index c8b4e09..f6decaf 100644 --- a/forum_modules/pgfulltext/handlers.py +++ b/forum_modules/pgfulltext/handlers.py @@ -5,7 +5,7 @@ from forum.modules.decorators import decorate @decorate(QuestionManager.search, needs_origin=False) def question_search(self, keywords): - repl_re = re.compile(r'[^\'-_\s\w]') + repl_re = re.compile(r"[^\'\-_\s\w]") tsquery = " | ".join([k for k in repl_re.sub('', keywords).split(' ') if k]) return self.extra(