X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/98b2c09ef1f1c8288a31517f61423264c6b3291c..1801c65004af14a8ed50d60e47d75a415753bbf7:/src/wolnelektury/utils.py diff --git a/src/wolnelektury/utils.py b/src/wolnelektury/utils.py index 8c5ead612..d20039cd2 100644 --- a/src/wolnelektury/utils.py +++ b/src/wolnelektury/utils.py @@ -12,6 +12,7 @@ from functools import wraps import pytz from inspect import getargspec +import re from django.core.mail import send_mail from django.http import HttpResponse from django.template import RequestContext @@ -149,3 +150,8 @@ class UnicodeCSVWriter(object): def writerows(self, rows): for row in rows: self.writerow(row) + + +# the original re.escape messes with unicode +def re_escape(s): + return re.sub(r"[(){}\[\].*?|^$\\+-]", r"\\\g<0>", s)