1
2
3
4
5
6
7
8
9
10
11
use regex::Regex;

pub fn clean_col_text(text: &str) -> String {
    let mut clean_text = text.trim().to_string();
    clean_text = Regex::new(r"^(\||\!)+|(\||\!)+$")
        .unwrap()
        .replace_all(&clean_text, "")
        .trim()
        .to_string();
    return  clean_text;
}