You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fn measure(pattern: &str, data: &str) {
let start = Instant::now();
let regex = Regex::new(pattern);
match regex {
Ok(re) => {
let count = re.find_iter(data).count();
let elapsed = Instant::now().duration_since(start);
println!("{} - {}", elapsed.as_secs_f64() * 1e3, count);
}
Err(err) => {
println!("{:?}", err);
}
}
}
prints
regex parse error:
.* x-x[[0-9]+] time="[0-9\.\:\-T]+" level=error msg="x x x x ([a-z0-9]{64}): x to x device ([a-z0-9]{64})-init:devicemapper: x x x x failed""
^^
error: unrecognized escape sequence
while other languages and online regex compile it just fine without changing the regex