fn clean_title(title: &str, matching: bool) -> String {
    let lowercase = title.to_lowercase();
    //Remove feat
    let mut re = Regex::new(r"(\(*)feat(\.*).*(\)*)$").unwrap();
    let result = re.replace(&lowercase, "");
    //Remove original mix
    re = Regex::new(r"(\(*)original( (mix|version))*(\)*)$").unwrap();
    let out = re.replace(&result, "");
    //Remove space, some problematic characters
    if matching {
        return out.to_string().replace(" ", "").replace(";", "").replace("&", "");
    }
    out.to_string()
}
//Matching = if matching remove also symbols
Matching = if matching remove also symbols
Matching = if matching remove also symbols
fn clean_title(title: &str, matching: bool) -> String {
    let lowercase = title.to_lowercase();
    //Remove feat
    let mut re = Regex::new(r"(\(*)feat(\.*).*(\)*)$").unwrap();
    let result = re.replace(&lowercase, "");
    //Remove original mix
    re = Regex::new(r"(\(*)original( (mix|version))*(\)*)$").unwrap();
    let out = re.replace(&result, "");
    //Remove space, some problematic characters
    if matching {
        return out.to_string().replace(" ", "").replace(";", "").replace("&", "");
    }
    out.to_string()
}
fn clean_title ( title : & str , matching : bool ) -> String { let lowercase = title . to_lowercase ( ) ; //Remove feat let mut re = Regex :: new ( r"(\(*)feat(\.*).*(\)*)$" ) . unwrap ( ) ; let result = re . replace ( & lowercase , " " ) ; //Remove original mix re = Regex :: new ( r"(\(*)original( (mix|version))*(\)*)$" ) . unwrap ( ) ; let out = re . replace ( & result , " " ) ; //Remove space, some problematic characters if matching { return out . to_string ( ) . replace ( " " , " " ) . replace ( " " , " " ) . replace ( " " , " " ) ; } out . to_string ( ) }
Matching = if matching remove also symbols
Matching = if matching remove also symbols
title
&str
matching
bool