diff --git a/regex/src/main.rs b/regex/src/main.rs index 87cfc22..73ec91b 100644 --- a/regex/src/main.rs +++ b/regex/src/main.rs @@ -18,7 +18,7 @@ fn main() { let re2 = Regex::new(r"(\d+)").unwrap(); println!("{}", re2.replace_all("Hello 100, 200", | caps: ®ex::Captures | { - "(".to_owned() + &caps[1] + ")" + "(".to_owned() + &(caps[1].parse::().unwrap() * 2).to_string() + ")" })); println!("{}", re2.replace_all("Hello 100, 200", | caps: ®ex::Captures<'_> | { "[".to_owned() + &caps[1] + "]"