// 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"gsScrollPos=(.*?);|gsScrollPos=(.*)").unwrap();
let string = "_jsuid=1540521894; new=verified; __insp_slim=1441894084306; __insp_wid=1141935839; __insp_nv=true; __insp_ref=d; __insp_targlpu=http%3A%2F%2Flocalhost%2F; __insp_norec_sess=true; aff_tag=55b88a; aff_from=; aff_time=1441896839; gsScrollPos=; _gat=1; _ga=GA1.1.1421736560.1435009203";
// 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/