From af222fd5260de2e43dd05be3c73b6976f0cfd852 Mon Sep 17 00:00:00 2001 From: B Krishna Chaitanya Date: Fri, 27 Jun 2014 11:58:59 +0530 Subject: [PATCH 1/3] Changed regex to accept symbols --- jrnl/Entry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jrnl/Entry.py b/jrnl/Entry.py index 461014fe..66109f32 100644 --- a/jrnl/Entry.py +++ b/jrnl/Entry.py @@ -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}][^\s]+)'.format(tags=self.journal.config['tagsymbols']), fulltext, re.UNICODE) self.tags = tags return set(tags) From ef0e192d7977c48a63e7f73d0b658f53cea2d105 Mon Sep 17 00:00:00 2001 From: B Krishna Chaitanya Date: Fri, 27 Jun 2014 21:08:10 +0530 Subject: [PATCH 2/3] Include [-+/*#] in tag characters --- jrnl/Entry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jrnl/Entry.py b/jrnl/Entry.py index 66109f32..9ff4f64a 100644 --- a/jrnl/Entry.py +++ b/jrnl/Entry.py @@ -18,7 +18,7 @@ class Entry: def parse_tags(self): fulltext = " ".join([self.title, self.body]).lower() - tags = re.findall(r'(?u)([{tags}][^\s]+)'.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) From add0aea46d272d762a0c5b2220fc09c5e10f929b Mon Sep 17 00:00:00 2001 From: B Krishna Chaitanya Date: Mon, 30 Jun 2014 14:38:00 +0530 Subject: [PATCH 3/3] Unescaped -, + and * in regex --- jrnl/Entry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jrnl/Entry.py b/jrnl/Entry.py index 9ff4f64a..31b607c9 100644 --- a/jrnl/Entry.py +++ b/jrnl/Entry.py @@ -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)