// 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"\d{2}:\d{2}:\d{2} \d*").unwrap();
let string = "23:58:02 106 23:58:07 105 23:58:12 103 23:58:17 98 23:58:22 100 23:58:27 97 23:58:32 99 23:58:37 100 23:58:42 99 23:58:47 104 23:58:52 95 23:58:57 96 23:59:02 98 23:59:07 96 23:59:12 104 23:59:17 109 23:59:22 105 23:59:27 111 23:59:32 111 23:59:37 104 23:59:42 110 23:59:47 100 23:59:52 106 23:59:57 114 00:00:02 123 00:00:07 130 00:00:12 130 00:00:17 125 00:00:22 119 00:00:27 116 00:00:32 122 00:00:37 116 00:00:42 119 00:00:47 117 00:00:52 114 00:00:57 114 00:01:02 110 00:01:07 103 00:01:12 98 00:01:17 98 00:01:22 102 00:01:27 97 00:01:32 99 00:01:37 93 00:01:42 97 00:01:47 103 00:01:52 96 00:01:57 93 00:02:02 93 00:02:07 95 00:02:12 106 00:02:17 99 00:02:22 102 00:02:27 96 00:02:32 93 00:02:37 97 00:02:42 102 00:02:47 101 00:02:52 95 00:02:57 92 00:03:02 100 00:03:07 95 00:03:12 102 00:03:17 102 00:03:22 109 00:03:27 109 00:03:32 107 00:03:37 111 00:03:42 112 00:03:47 113 00:03:52 115 ";
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/