// 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)(?<=says\sto)[\s\S]*?(?=\(\d{4}-\d{2}-\d{2}\s(\d\d:){2}\d{2}\s\w{2}\s\w{3}\))").unwrap();
let string = "(2021-07-04 11:58:43 PM BST)
---
len wee zim (Tradition (US) ) says to yohan sen
[[:Conversations will be recorded and may be monitored by the participants and
their employers:]] Hi yohan
(2021-07-05 12:04:42 AM BST)
---
len wee zim (Tradition (US) ) says to yohan sen
okay -5 / 0 .
(2021-07-04 11:47:14 PM BST)
---
Ke Cho Ki says to
Hano Cho
hello
(2021-07-05 12:09:41 AM BST)
---
len wee zim (Tradition (Asia)) says
to yohan sen
yes -5 / 0 TN -- / +2.5
---
* * *
Processed by wokl Archive for son malab | 2021-07-05 12:26:44 AM
BST
---";
let substitution = "";
// result will be a String with the substituted value
let result = regex.replace_all(string, substitution);
println!("{}", result);
}
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/