// 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)(?:github.com)(.*)").unwrap();
let string = "# [JSBox ](https://github.com/axelburks/JSBox?files=1) script
/
[Extract Scheme](https://github.com/axelburks/JSBox/tree/master/Extract%20Scheme)
[over 1 year ago](https://github.com/axelburks/JSBox/tree/master/Extract%20Scheme) [Launcher](https://github.com/axelburks/JSBox/tree/master/Launcher)
[over 1 year ago](https://github.com/axelburks/JSBox/tree/master/Launcher) [Magic Launcher](https://github.com/axelburks/JSBox/tree/master/Magic%20Launcher)
[8 months ago](https://github.com/axelburks/JSBox/tree/master/Magic%20Launcher) [Schedule Message](https://github.com/axelburks/JSBox/tree/master/Schedule%20Message)
[over 1 year ago](https://github.com/axelburks/JSBox/tree/master/Schedule%20Message) [XPin](https://github.com/axelburks/JSBox/tree/master/XPin)
[3 days ago](https://github.com/axelburks/JSBox/tree/master/XPin) [iTunes Utilities](https://github.com/axelburks/JSBox/tree/master/iTunes%20Utilities)
[6 months ago](https://github.com/axelburks/JSBox/tree/master/iTunes%20Utilities) [Boom.js](https://github.com/axelburks/JSBox/blob/master/Boom.js)
[almost 2 years ago](https://github.com/axelburks/JSBox/blob/master/Boom.js) [Clip Editor.js](https://github.com/axelburks/JSBox/blob/master/Clip%20Editor.js)
[about 1 year ago](https://github.com/axelburks/JSBox/blob/master/Clip%20Editor.js) [Downloader.js](https://github.com/axelburks/JSBox/blob/master/Downloader.js)
[over 1 year ago](https://github.com/axelburks/JSBox/blob/master/Downloader.js) [Emoji.js](https://github.com/axelburks/JSBox/blob/master/Emoji.js)
[almost 2 years ago](https://github.com/axelburks/JSBox/blob/master/Emoji.js) [IPA Installer.js](https://github.com/axelburks/JSBox/blob/master/IPA%20Installer.js)
[about 2 months ago](https://github.com/axelburks/JSBox/blob/master/IPA%20Installer.js) [Installer.js](https://github.com/axelburks/JSBox/blob/master/Installer.js)
[over 1 year ago](https://github.com/axelburks/JSBox/blob/master/Installer.js) [Pushbullet.js](https://github.com/axelburks/JSBox/blob/master/Pushbullet.js)
[about 1 year ago](https://github.com/axelburks/JSBox/blob/master/Pushbullet.js) [README.md](https://github.com/axelburks/JSBox/blob/master/README.md)
[about 2 months ago](https://github.com/axelburks/JSBox/blob/master/README.md) [SM.MS.js](https://github.com/axelburks/JSBox/blob/master/SM.MS.js)
[over 1 year ago](https://github.com/axelburks/JSBox/blob/master/SM.MS.js) [Shorten.js](https://github.com/axelburks/JSBox/blob/master/Shorten.js)
[about 1 year ago](https://github.com/axelburks/JSBox/blob/master/Shorten.js) [Thunder.js](https://github.com/axelburks/JSBox/blob/master/Thunder.js)
[about 1 year ago](https://github.com/axelburks/JSBox/blob/master/Thunder.js) [Tool Box play_icon.png](https://github.com/axelburks/JSBox/blob/master/Tool%20Box%20play_icon.png)
[almost 2 years ago](https://github.com/axelburks/JSBox/blob/master/Tool%20Box%20play_icon.png) [Tool Box.js](https://github.com/axelburks/JSBox/blob/master/Tool%20Box.js)
[over 1 year ago](https://github.com/axelburks/JSBox/blob/master/Tool%20Box.js) [Weico.js](https://github.com/axelburks/JSBox/blob/master/Weico.js)
[almost 2 years ago](https://github.com/axelburks/JSBox/blob/master/Weico.js) [XQRcode.js](https://github.com/axelburks/JSBox/blob/master/XQRcode.js)
[about 1 year ago](https://github.com/axelburks/JSBox/blob/master/XQRcode.js) [updateInfo](https://github.com/axelburks/JSBox/blob/master/updateInfo)
[over 1 year ago](https://github.com/axelburks/JSBox/blob/master/updateInfo) [version.json](https://github.com/axelburks/JSBox/blob/master/version.json)
[about 2 months ago](https://github.com/axelburks/JSBox/blob/master/version.json) ";
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/