From 7e3f4b67fe10ea13045dadba73a157b09d90c9dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=93=E9=B9=8F?= Date: Fri, 18 Dec 2020 19:22:11 +0800 Subject: [PATCH] windows "re" but windows path like '\' need other '\' escape --- bin/autojump_match.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/autojump_match.py b/bin/autojump_match.py index 8747b908..4fe38149 100644 --- a/bin/autojump_match.py +++ b/bin/autojump_match.py @@ -75,7 +75,7 @@ def match_consecutive(needles, haystack, ignore_case=False): (path='/foo/baz', weight=10), ] """ - regex_no_sep = '[^' + os.sep + ']*' + regex_no_sep = '[^\\' + os.sep + ']*' regex_no_sep_end = regex_no_sep + '$' regex_one_sep = regex_no_sep + os.sep + regex_no_sep regex_needle = regex_one_sep.join(imap(re.escape, needles)) + regex_no_sep_end