diff --git a/src/parser.rs b/src/parser.rs index 6e36015..54ad8ad 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -83,7 +83,7 @@ fn get_tags(regex: &::regex::Regex, subject: &str) -> Vec { macro_rules! regex_tags_shared { () => { - "(?P^|[\\s]){}(?P[\\w-]+)" + "(?P^|[\\s]){}(?P[\\w\\\\-]+)" }; } diff --git a/tests/parser.rs b/tests/parser.rs index 41cb190..4b30bc9 100644 --- a/tests/parser.rs +++ b/tests/parser.rs @@ -105,11 +105,11 @@ fn deplucate_contexts() { #[test] fn projects() { - let line = "Email SoAndSo at soandso@example.com +project1 @context2".to_owned(); + let line = "Email SoAndSo at soandso@example.com +project1 +project1\\subject1 @context2".to_owned(); let task = ::todo_txt::Task { - subject: "Email SoAndSo at soandso@example.com +project1 @context2".to_owned(), + subject: "Email SoAndSo at soandso@example.com +project1 +project1\\subject1 @context2".to_owned(), contexts: vec!["context2".to_owned()], - projects: vec!["project1".to_owned()], + projects: vec!["project1".to_owned(), "project1\\subject1".to_owned()], ..Default::default() };