// 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)(?:.*|)NY TORRENT: [a-zA-Z&]+ \w+ (.*-[a-zA-Z]+).*").unwrap();
let string = "NY TORRENT: Dance Single Croatia_Squad_-_Touch_Me-(ETR236)-WEB-2014-XDS 41.62MB (http://tunetraxx.org/?p=torrents&pid=10&action=details&tid=1972)
NY TORRENT: Dance Single Croatia_Squad_-_Touch_Me-(ETR236)-WEB-2014-XDS 41.62MB (http://tunetraxx.org/?p=torrents&pid=10&action=details&tid=1972)
NY TORRENT: R&B Album David_Guetta-Listen-2CD-2014-VOiCE 116.67MB (http://tunetraxx.org/?p=torrents&pid=10&action=details&tid=1973)
NY TORRENT: Club Single DJ_EBO_-_Triple_Jump_98-Vinyl-1998-iDC 33.98MB (http://tunetraxx.org/?p=torrents&pid=10&action=details&tid=1974)
(22:15:27) (@TTBot) NY TORRENT: Dance Single Audio_Hedz_and_Bones_-_Boom_Bang-(OMP_004)-WEB-2013-NRG 14.58MB (http://tunetraxx.org/?p=torrents&pid=10&action=details&tid=1749)
(22:15:27) (@TTBot) NY TORRENT: Dance Single Bounce_Enforcerz_-_Good_Dawn-(RRBEG)-WEB-2014-NRG 16.12MB (http://tunetraxx.org/?p=torrents&pid=10&action=details&tid=1750)";
let substitution = "\\1";
// 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/