Partially working filtering logic

This commit is contained in:
2023-08-08 10:50:04 -06:00
parent afeb333100
commit 25730a3324
13 changed files with 362 additions and 48 deletions
+8
View File
@@ -2,6 +2,7 @@ use log::LevelFilter;
use log4rs::append::file::FileAppender;
use log4rs::config::{Appender, Root};
use log4rs::encode::pattern::PatternEncoder;
use regex::Regex;
pub fn init_logging_config() -> log4rs::Config {
let file_path = "/tmp/managarr.log";
@@ -30,3 +31,10 @@ pub fn convert_runtime(runtime: u64) -> (u64, u64) {
(hours, minutes)
}
pub fn strip_non_alphanumeric_characters(input: &str) -> String {
Regex::new(r"[^a-zA-Z0-9\s]")
.unwrap()
.replace_all(&input.to_lowercase(), "")
.to_string()
}