ref
This commit is contained in:
@@ -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::<usize>().unwrap() * 2).to_string() + ")"
|
||||
}));
|
||||
println!("{}", re2.replace_all("Hello 100, 200", | caps: ®ex::Captures<'_> | {
|
||||
"[".to_owned() + &caps[1] + "]"
|
||||
|
||||
Reference in New Issue
Block a user