// 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)SoapWriter\.\d+ (?:- )?\[[0-9a-z]* [0-9a-z]*\] - (?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})? - ((?:.|\n|\r)*)").unwrap();
let string = "2021-02-25 14:06:25,810 [http-bio-8080-exec-70] INFO com.example.SoapWriter.27 - [7fbe6d227aa053b9 7fbe6d227aa053b9] - - <?xml version=\"1.0\" encoding=\"UTF-8\"?><soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><soapenv:Body><processSync xmlns=\"urn:soap\"><in0><?xml version="1.0" encoding="UTF-8"?><ESROrder xmlns="http://www.example.com/xsd/sea" xmlns:icp="http://www.atis.org/obf/wir/wicis5/schemas">
<OrderDetails>
<RequestDetails>
<CustomerName>example</CustomerName>
<SupplierName>example</SupplierName>
<OrderType>example</OrderType>
<OrderSubtype>example</OrderSubtype>
<Event>new</Event>
</in0></processSync></soapenv:Body></soapenv:Envelope>";
// 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/