// 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)[^\n.!?:]*(?:thanks|thank[ -]you|(?:please|plz|h[ea]l?p|suggest(?:ions)|th?anks|thx|tanx|could)\b[^\n.!?:]*\b(?:h[ea]lp|ap+reciat\w*|me|advan\w*|a ?lot))\b[^\n.!?:]*[.!?]*[ ]*").unwrap();
let string = "I don't know what's going on. Any help would be appreciated. How can I do this?
Any suggestions are appreciated :)
Please help me, i will thank you. How I do this?
I hope you guys can help me. Thanks for any help.
All suggestions are appreciated, thanks
Thanks in advance.
Could you hep me?
I hope you can plz help me buddy!
please halp
Can someone plz guide me where I am going wrong ?
I have no teacher or any instructor because I am learning programming on my own, so please any help is appreciated. Thanks
tanx in advance!
tanks in advance!
Thanks in advance!
kindly help me with the step by step solution.. thanks in advance
__Thanks in advance.__
Thanks a lot!
Thank you!!!
also id like to thank you for any help in advance. let me first state that i am aware of possible security issues and will address those accordingly.
thanks!!
Do Not Match:
Software for tanks. It would please my boss.
Please look at this example.
Thanks to Microsoft, I can no longer log in to my email.
";
// result will be an iterator over tuples containing the start and end indices for each match in the string
let result = regex.captures_iter(string);
for mat in result {
println!("{:?}", mat);
}
}
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/