// 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"(?im)(\<\!\-{2})([a-z\ ]*)(\-{2}\>)").unwrap();
let string = "<header class=\"noSelect\">
<div id=\"HIAccueil\" class=\"I-B\">
<img class=\"pointer\" src=\"IMG/BACKGROUND/HEADER/logoban.png\" alt=\"Accueil\" onclick=\"clickMenu(tousLesMenus, 2, tousLesMenus[0].nom, 1, 0, 0, 0, tousLesMenus[1].url);\">
</div>
<div id=\"HIPC\">
<div id=\"HIProfile\" class=\"I-B\">
<!-- vide pour img via js -->
</div>
<div id=\"HIConnect\" class=\"I-B\">
<img class=\"pointer\" src=\"IMG/BACKGROUND/HEADER/connect_hover.gif\" alt=\"Connect\" onclick=\"clickMenu(tousLesMenus, 5, tousLesMenus[0].nom, 4, 1, 1, 0, tousLesMenus[4].url);\">
</div>
</div>
</header>
Tralloc_Nivek-02.baza_R-d421@gmail45.com
Tralloc_Nivek-02@gmail45.com
Tralloc_Nivek-02.baza_R-d421gmail45.c
010/226679
010226679
010/22.66.79
010/22 66 79
0470040747
0470/040747
0470/040.747
0470/04.07.47
0470/04 07 47
0470/040 747
+0032470040747
0032470/040 747
+00320470040747";
// 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/