From 49df0470f835bc33bacc40c1a27e7e337218c2fb Mon Sep 17 00:00:00 2001 From: Alexander Mironov Date: Tue, 13 Jul 2021 11:43:47 +0400 Subject: [PATCH] Optimize heuritstic --- src/utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.rs b/src/utils.rs index 7be64db..89c352f 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -93,7 +93,7 @@ pub fn heuristic(body: &str) -> Vec { found.push(re_var.replace_all(&cap[0], "").to_string()); } - let re_words_in_quotes = Regex::new(r#"("|')\w{3,20}('|")"#).unwrap(); + let re_words_in_quotes = Regex::new(r#"("|')[a-zA-Z0-9]{3,20}('|")"#).unwrap(); for cap in re_words_in_quotes.captures_iter(body) { found.push(re_special_chars.replace_all(&cap[0], "").to_string()); }