// 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"^uuid.*\n").unwrap();
let string = "uuid: d0856f49-30d3-4448-8fde-1e3373821bd9
langcode: en
status: true
dependencies: { }
_core:
default_config_hash: zglzjmYxi0G0ag9MZ02y0LSJOdpWRwJxyP_OvFojFyo
id: basic
label: 'Basic Block'
revision: 0
description: 'A basic block contains a title and a body.'
";
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/