// 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)([0-9A-f]{2}[:-]){5}[0-9A-f]{2}").unwrap();
let string = "1031AP9 2 AIR-CAP3502I-A-K9 2c:54:2d:0a:1a:1e default location US 10.10.131.108 0 [0 ,0 ,0 ]
1031AP4 2 AIR-CAP3502I-A-K9 2c:54:2d:0d:d6:d0 default location US 10.10.131.94 1 [0 ,0 ,0 ]
1031AP5 2 AIR-CAP3502I-A-K9 2c:54:2d:13:04:d5 default location US 10.10.131.107 6 [0 ,0 ,0 ]
1031AP11 2 AIR-CAP3702I-B-K9 a0:e0:af:6a:80:a4 default location US 10.10.131.106 1 [0 ,0 ,0 ]
1031AP6 2 AIR-CAP3502I-A-K9 2c:54:2d:13:05:24 default location US 10.10.131.101 1 [0 ,0 ,0 ]
1031AP2 2 AIR-CAP3502I-A-K9 2c:54:2d:0a:1b:f4 default location US 10.10.131.109 0 [0 ,0 ,0 ]
1031AP3 2 AIR-CAP3502I-A-K9 2c:54:2d:0a:1a:c6 default location US 10.10.131.104 0 [0 ,0 ,0 ]
1031AP8 2 AIR-CAP3702I-B-K9 d4:c9:3c:9d:4a:f4 default location US 10.10.131.114 3 [0 ,0 ,0 ]
1031AP1 2 AIR-CAP3502I-A-K9 2c:54:2d:0d:d7:11 default location US 10.10.131.105 3 [0 ,0 ,0 ]
1031AP7 2 AIR-CAP3502I-A-K9 2c:54:2d:0a:1c:21 default location US 10.10.131.93 0 [0 ,0 ,0 ]
1031AP10 2 AIR-CAP3502I-A-K9 2c:54:2d:13:02:53 default location US 10.10.131.103 0 [0 ,0 ,0 ]";
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/