// 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"(?<=EUR)\n\n(.*?(?=\s))\s(.*?(?=\s))\s(.*?(?=\s))\s(.*?(?=\s))\s(.*?(?=\s))").unwrap();
let string = "01 9768332B SPC Tablet 10.1\" IPS Gravity Pro 3GB RAM 32GB Blan 1,00 101,99 0,00 101,99
Base Imponible +LPI IVA Cuota IVA Recargo Cuota Recargo Importe Total: 104,99 EUR
104,99 0,00 0,00 0,00 0,00
Forma de pago: RECIBO DOMICILIADO A 20 D-B2B Vencimientos: 26/11/2020 104,99 EUR
Dirección de giro: ES68 2100 4566 22 0200110380
Días de pago: COBRO TODOS DIAS";
// 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/