From 8e03a28042423e1a06f3e00e508ef6a52c96226e Mon Sep 17 00:00:00 2001 From: William Pettersson Date: Fri, 1 Jun 2018 13:52:59 +0100 Subject: [PATCH] Fix crash when searching with backslash --- todotxt_machine/todo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/todotxt_machine/todo.py b/todotxt_machine/todo.py index 2d49005..f1173e1 100644 --- a/todotxt_machine/todo.py +++ b/todotxt_machine/todo.py @@ -338,7 +338,7 @@ def search(self, search_string): search_string = re.escape(search_string) # print(search_string) ss = [] - substrings = search_string.split("\\") + substrings = search_string.split("\\\\") for index, substring in enumerate(substrings): s = ".*?".join(substring) # s.replace(" .*?", " ") @@ -347,7 +347,7 @@ def search(self, search_string): ss.append(s) # print(repr(ss)) search_string_regex = '^.*(' - search_string_regex += "\\".join(ss) + search_string_regex += "\\\\".join(ss) search_string_regex += ').*' # print(search_string_regex)