// 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"(?i)by([^(b(?>y))])+").unwrap();
let string = "zzzzzzzzzzzzzzzzzzeererezzz By LITE-ON!Model: PA-1121-12H, PA-1121-12R!Series: PPP017L!HP Part No.: 316688-001, 394900-001, 393946-001!!By HIPRO!Model: HP-OW121F13!Series: PPP017H!HP Part No.: 316688-002!!By Fordgood!Model: 0309A18120!Series: PPP017S!HP Part No.: 316688-003 !Replace with HP Spare No.: 317188-001!Compatible HP Spare No.: 350775-001!!Input: 110-240V~ 2.5A, 50-60Hz!Output: 18.5V 6.5A 120W!Connecter size: Int. Diameter: 2.50mm Ext. Diameter: 5.50mm Length : 14.00mm!!Dimension: 168 x 62 x 37 mm!!*For use with Presario 3000xx notebook series.!!**Please take note, 3 wire AC power cord not included.!!/by([^(b(?>y))])+/gi";
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/