// 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)(?<=\<OBJ_CODE\>).*(?=\<\/OBJ_CODE\>)").unwrap();
let string = " <OBJ_CODE>(01)08699543091808(21)1000153104910(91)9185(92)92JEIF840$JDFDSA!L;ASDJASDMASDLKFJANE;ASDFLHJA(17)251231</OBJ_CODE>
</item>
<item>
<OBJ_CODE>(01)08699543091808(21)1000181393500(91)9185(92)92546KLJDF(G9)AALDFJ^KLJBN346#NDSFL%LKJADADNRI(17)251231</OBJ_CODE>
</item>
<item>
<OBJ_CODE>(01)08699543091808(21)1000121219920(91)9185(92)92489345MDFSLK8945893,5HJDSFKL3$LKJSDGFALKJDFG(17)251231</OBJ_CODE>
</item>
<item>
<OBJ_CODE>(01)08699543091808(21)1000164832760(91)9185(92)92DSAFL48904!KASDFG^;LKJASDF%ASDFLKJNASL34JD34(17)251231</OBJ_CODE>
</item>
<item>
<OBJ_CODE>(01)08699543091808(21)1000124140420(91)9185(92)92%LSDAFASDF9084A;LKLJ!;LK(23)4ASDF724LK$LJ$;L(17)251231</OBJ_CODE>
</item>
<item>
<OBJ_CODE>(01)08699543091808(21)1000161028910(91)9185(92)92834HASKLJHSDA$KJH%;LHJL(DF)^ASDFKLJDSFLKW!;L(17)251231</OBJ_CODE>
</item>
<item>
<OBJ_CODE>(01)08699543091808(21)1000135787250(91)9185(92)9290KLKLNAB%KLJAKLJ^7DSFKLJASDG234KLJSD#4LHASD(17)251231</OBJ_CODE>";
// 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/