// include the latest version of the regex crate in your Cargo.toml
extern crate regex;
use regex::Regex;
fn main() {
let regex = Regex::new(r"(?i)(\b)(https?:\/\/)(www.)?[\w-]{2,}\.[a-zA-Z\-0-9]{1,}[\w\/\.\?\=\&\#\-\%\+]*(\b)").unwrap();
let string = "http://127.0.0.1/openserver/phpmyadmin/sql.php?db=projectx&table=messages&sql_query=SELECT+%2A+FROM+%60messages%60&message_to_show=%D0%97%D0%B0%D0%BF%D0%B8%D1%81%D1%8C+%D0%B1%D1%8B%D0%BB%D0%B0+%D1%83%D0%B4%D0%B0%D0%BB%D0%B5%D0%BD%D0%B0&goto=tbl_sql.php&token=81b4b5c88dae1706231d6cd2ab925edb&message=%D0%A3%D0%B4%D0%B0%D0%BB%D0%B5%D0%BD%D0%B0+1+%D1%81%D1%82%D1%80%D0%BE%D0%BA%D0%B0.+%28%D0%97%D0%B0%D0%BF%D1%80%D0%BE%D1%81+%D0%B7%D0%B0%D0%BD%D1%8F%D0%BB+0.1904+%D1%81%D0%B5%D0%BA.%29
sd fs ";
let substitution = "";
// result will be a String with the substituted value
let result = regex.replace_all(string, substitution);
println!("{}", result);
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Rust, please visit: https://docs.rs/regex/latest/regex/