Unescaped -, + and * in regex

This commit is contained in:
B Krishna Chaitanya 2014-06-30 14:38:00 +05:30
parent 8b45458f90
commit a2be5d25fc

View file

@ -18,7 +18,7 @@ class Entry:
def parse_tags(self):
fulltext = " ".join([self.title, self.body]).lower()
tags = re.findall(r'(?u)([{tags}][\w\+/\-\*#]+)'.format(tags=self.journal.config['tagsymbols']), fulltext, re.UNICODE)
tags = re.findall(r'(?u)([{tags}][-+*#/\w]+)'.format(tags=self.journal.config['tagsymbols']), fulltext, re.UNICODE)
self.tags = tags
return set(tags)