// 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)(?<=[A-Za-z]\d:)\w+(?=\D+ )").unwrap();
let string = "08:27:08,946 INFO [com.cars.bdlx.manageinvoice.common.ManageInvoiceService-170] (http-/0.0.0.0:8080-22) REQUEST:V4:dUowlr45NG88:GET_INVOICE_PDF InvoicePdfRequest[customerID=12345678,accountNumber=987654321,invoiceNumber=33333333,countryCode=UK,page=<null>,pageFrom=<null>,pageTo=<null>,copy=false,billingSystemID=MOB,date=<null>,brand=TIGER,callingSystem=Base,userId=777777777,additionalRights=<null>]
08:27:08,244 INFO [TIME-460] (http-/0.0.0.0:8080-7) TIME:V4:YpXGo1j4dMcS:GET_INVOICE_PDF:0.048
";
// 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/