diff --git a/Cargo.lock b/Cargo.lock index 6f9fd2f..467d253 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1314,7 +1314,7 @@ dependencies = [ [[package]] name = "reminder_rs" -version = "1.4.0" +version = "1.4.1" dependencies = [ "Inflector", "chrono", diff --git a/Cargo.toml b/Cargo.toml index aea3116..db3cc76 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "reminder_rs" -version = "1.4.0" +version = "1.4.1" authors = ["jellywx "] edition = "2018" diff --git a/src/consts.rs b/src/consts.rs index 34037e1..778b402 100644 --- a/src/consts.rs +++ b/src/consts.rs @@ -33,7 +33,7 @@ const THEME_COLOR_FALLBACK: u32 = 0x8fb677; use std::{collections::HashSet, env, iter::FromIterator}; -use regex::Regex; +use regex::{Regex, RegexBuilder}; lazy_static! { pub static ref REGEX_CHANNEL: Regex = Regex::new(r#"^\s*<#(\d+)>\s*$"#).unwrap(); @@ -49,19 +49,25 @@ lazy_static! { pub static ref REGEX_CHANNEL_USER: Regex = Regex::new(r#"\s*<(#|@)(?:!)?(\d+)>\s*"#).unwrap(); - pub static ref REGEX_REMIND_COMMAND: Regex = Regex::new( + pub static ref REGEX_REMIND_COMMAND: Regex = RegexBuilder::new( r#"(?P(?:<@\d+>\s|<@!\d+>\s|<#\d+>\s)*)(?P