From 4274e8539a3885262f8a3452cd0b05ff070b6426 Mon Sep 17 00:00:00 2001 From: tretrauit Date: Thu, 25 Jan 2024 01:15:44 +0700 Subject: [PATCH] fix(katana): lower short string & append last character --- swordfish/src/tesseract/utils.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/swordfish/src/tesseract/utils.rs b/swordfish/src/tesseract/utils.rs index 3a8ca5c..8f765c8 100644 --- a/swordfish/src/tesseract/utils.rs +++ b/swordfish/src/tesseract/utils.rs @@ -195,6 +195,7 @@ pub fn regexify_text(text: &String) -> String { } // Filter for short string. if short_text && !ascii_text.contains(|c: char| c.is_whitespace()) { + ascii_text = ascii_text.to_lowercase(); regex.push_str("^"); let mut request_quantifier: bool = false; let mut regex_any: bool = false; @@ -210,6 +211,7 @@ pub fn regexify_text(text: &String) -> String { continue; } else if i == ascii_text.len() - 1 { regex.push_str(".*"); + regex.push(char); } if regex_any { if char == ']' {