// 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#"(?m)XX\.[A-Za-z]*\("(.*)",\s*([0-9A-Za-z]{2})\)"#).unwrap();
let string = "[XX.Ux(\"gI\\ny\", sl), Ar, XX.Rx(\"\\t|\", pO), Jd, XX.kx(\"xW\\n\", CM), Wm, XX.wx(\"U\\vyV\", DO), jr, XX.Mx(\"U\\vxW\", GO), Zm, XX.tx(\"a{O\", xO), Hm, XX.RV(Qk, Hl, Q0), Qd, XX.Nx(\"\\t|\", OM), Br, XX.zx(\"{I\\v\", vM), jd, XX.gx(\"U\\vxS\", W6), nm, XX.kV(Qk, UM, Q0), Bd, XX.rx(\"\\t|\", RM), Xm, XX.mx(\"V\\r\", kM), Id, XX.dx(\"J\\t~\", KY), Lm, XX.hx(\"xV\\v\", wN), Sd, XX.bx(\"xU\\x00\", d6), rd, XX.Cx(\"axK\", BM), Wd, XX.qx(\"}~\", h6), Zd, XX.sx(\"gI\\b\", b6), Hd, XX.Kx(\"xU\", C6), Lh, XX.Wx(\"U\\ry\", q6), pm[\"fpValStr\"], XX.wV(Qk, Ml, F0), vd, XX.Zx(\"sH\", LN), jm, XX.Hx(\"{I\\f\", jM), Xh], Vh && (Wr.push(XX.nx(\"xT\", XN), XX.Ax(\"\", VN)), Th = j3(N3)), Wr.push(XX.Fx(\"J\\nu\", nY), Md), Kr = ph(j2, [Wr, A0]), Dh = Wr.join(Kr), qr(XX.Ex(\"9I\\x00\", TN).concat(Dh[\"slice\"](N3, W0)));
";
// 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/