// 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#"(?s).*?"artists".*?jpg"\},"name":"(.*?)".*?catalog_number":"(.*?)".*?\},"name":"(.*?)","new_release_date":"(.*?)".*?|.*<\/html>"#).unwrap();
let string = ",\"publish_date\":\"2022-05-04\",\"remixers\":[],\"slug\":\"independiente\",\"track_count\":2,\"upc\":\"5057272832285\",\"updated\":\"2022-05-04T00:09:42-06:00\",\"url\":\"https://api-internal.beatportprod.com/v4/catalog/releases/3713459/\",\"is_hype\":false},{\"artists\":[{\"id\":637976,\"image\":{\"id\":5539565,\"uri\":\"https://geo-media.beatport.com/image_size/590x404/0dc61986-bccf-49d4-8fad-6b147ea8f327.jpg\",\"dynamic_uri\":\"https://geo-media.beatport.com/image_size/{w}x{h}/0dc61986-bccf-49d4-8fad-6b147ea8f327.jpg\"},\"name\":\"SounEmot\",\"slug\":\"sounemot\",\"url\":\"https://api-internal.beatportprod.com/v4/catalog/artists/637976/\"}],\"bpm_range\":{\"min\":123,\"max\":140},\"catalog_number\":\"
HER032\",\"desc\":\"Liquid Dream is back home with this wonderful remix that gives a different feeling to the original \\\"The Best Of You\\\" from \\\"SounEmot\\\"\",\"enabled\":true,\"encoded_date\":\"2022-03-05T11:04:53-07:00\",\"exclusive\":false,\"id\":3677155,\"image\":{\"id\":32123136,\"uri\":\"https://geo-media.beatport.com/image_size/1400x1400/df8b2729-302c-4965-86fe-bdc156d472be.jpg\",\"dynamic_uri\":\"https://geo-media.beatport.com/image_size/{w}x{h}/df8b2729-302c-4965-86fe-bdc156d472be.jpg\"},\"label\":{\"id\":96888,\"name\":\"High Emotions Recordings\",\"image\":{\"id\":34769235,\"uri\":\"https://geo-media.beatport.com/image_size/500x500/fcd8bb5d-04f6-4713-ae37-100f4efa54cf.jpg\",\"dynamic_uri\":\"https://geo-media.beatport.com/image_size/{w}x{h}/fcd8bb5d-04f6-4713-ae37-100f4efa54cf.jpg\"},\"slug\":\"high-emotions-recordings\"},\"name\":\"The Best of You Remixed (Liquid Dream Remix)\",\"new_release_date\":\"2022-04-29\",\"override_price\":null,\"pre_order\":false,\"pre_order_date\":null,\"price\":{\"code\":\"USD\",\"symbol\":\"$\",\"value\":2.58,\"display\":\"$2.58\"},\"price_override_firm\":false,\"publish_date\":\"2022-04-29\",\"remixers\":[{\"id\":685512,\"image\":{\"id\":5539565,\"uri\":\"https://geo-media.beatport.com/image_size/590x404/0dc61986-bccf-49d4-8fad-6b147ea8f327.jpg\",\"dynamic_uri\":\"https://geo-media.beatport.com/image_size/{w}x{h}/0dc61986-bccf-49d4-8fad-6b147ea8f327.jpg\"},\"name\":\"Liquid Dream\",\"slug\":\"liquid-dream\",\"url\":\"https://api-internal.beatportprod.com/v4/catalog/artists/685512/\"}],\"slug\":\"the-best-of-you-remixed-liquid-dream-remix\",\"track_count\":2,\"upc\":\"5057272794156\",\"updated\":\"2022-09-12T13:02:18-06:00\",\"url\":\"https://api-internal.beatportprod.com/v4/catalog/releases/3677155/\",\"is_hype\":false},{\"artists\":[{\"id\":378771,\"image\":{\"id\":5539565,\"uri\":\"https://geo-media.beatport.com/image_size/590x404/0dc61986-bccf-49d4-8fad-6b147ea8f327.jpg\",\"dynamic_uri\":\"https://geo-media.beatport.com/image_size/{w}x{h}/0dc61986-bccf-49d4-8fad-6b147ea8f327.jpg\"},\"name\":\"Boriz Vicious\",\"slug\":\"boriz-vicious\",\"url\":\"https://api-internal.beatportprod.com/v4/catalog/artists/378771/\"}],\"bpm_range\":{\"min\":140,\"max\":140},\"catalog_number\":\"HER032\",\"desc\":\"Boriz Vicious makes his debut in High Emotions.\\nwith these two tracks very much in his Boriz Vicious style \\\"Blood Moon \\u0026 Adios Madre\\\".\",\"enabled\":true,\"encoded_date\":\"2022-03-25T10:48:00-06:00\",\"exclusive\":false,\"id\":3699985,\"image\":{\"id\":30933010,\"uri\":\"https://geo-media.beatport.com/image_size/1400x1400/c5b73e0c-f607-4eab-aab5-0c4f1e228bce.jpg\",\"dynamic_uri\":\"https://geo-media.beatport.com/image_size/{w}x{h}/c5b73e0c-f607-4eab-aab5-0c4f1e228bce.jpg\"},\"label\":{\"id\":96888,\"name\":\"High Emotions Recordings\",\"image\":{\"id\":34769235,\"uri\":\"https://geo-media.beatport.com/image_size/500x500/fcd8bb5d-04f6-4713-ae37-100f4efa54cf.jpg\",\"dynamic_uri\":\"https://geo-media.beatport.com/image_size/{w}x{h}/fcd8bb5d-04f6-4713-ae37-100f4efa54cf.jpg\"},\"slug\":\"high-emotions-recordings\"},\"name\":\"Blood Moon / Adios Madre\",\"new_release_date\":\"2022-04-27\",\"override_price\":null,\"pre_order\":false,\"pre_order_date\":null,\"price\":{\"code\":\"USD\",\"symbol\":\"$\",\"value\":2.58,\"display\":\"$2.58\"},\"price_override_firm\":false,\"publish_date\":\"2022-04-27\",\"remixers\":[],\"slug\":\"blood-moon-adios-madre\",\"track_count\":2,\"upc\":\"5057272816414\",\"updated\":\"2022-04-27T00:10:41-06:00\",\"url\":\"https://api-internal.beatportprod.com/v4/catalog/releases/3699985/\",\"is_hype\":false},{\"artists\":[{\"id\":885794,\"image\":{\"id\":5539565,\"uri\":\"https://geo-media.beatport.com/image_size/590x404/0dc61986-bccf-49d4-8fad-6b147ea8f327.jpg\",\"dynamic_uri\":\"https://geo-media.beatport.com/image_size/{w}x{h}/0dc61986-bccf-49d4-8fad-6b147ea8f327.jpg\"},\"name\":\"Cj Mover\",\"slug\":\"cj-mover\",\"url\":\"https://api-internal.beatportprod.com/v4/catalog/artists/885794/\"}],\"bpm_range\":{\"min\":140,\"max\":141},\"catalog_number\":\"HER031\",\"desc\":\"An energetic track with guitar plucks is present in High Emotions, \\\"Cj Mover\\\" makes its mark with this great track \\\"Hope Dies Last\\\".\",\"enabled\":true,\"encoded_date\":\"2022-03-15T21:03:30-06:00\",\"exclusive\":false,\"id\":3690041,\"image\":{\"id\":30809730,\"uri\":\"https://geo-media.beatport.com/image_size/1400x1400/e37973b3-c3b7-465e-b7b7-9a8367a6c430.jpg\",\"dynamic_uri\":\"https://geo-media.beatport.com/image_size/{w}x{h}/e37973b3-c3b7-465e-b7b7-9a8367a6c430.jpg\"},\"label\":{\"id\":96888,\"name\":\"High Emotions Recordings\",\"image\":{\"id\":34769235,\"uri\":\"https://geo-media.beatport.com/image_size/500x500/fcd8bb5d-04f6-4713-ae37-100f4efa54cf.jpg\",\"dynamic_uri\":\"https://geo-media.beatport.com/image_size/{w}x{h}/fcd8bb5d-04f6-4713-ae37-100f4efa54cf.jpg\"},\"slug\":\"high-emotions-recordings\"},\"name\":\"Hope Dies Last\",\"new_release_date\":\"2022-04-20\",\"override_price\":null,\"pre_order\":false,\"pre_order_date\":null,\"price\":{\"code\":\"USD\",\"symbol\":\"$\",\"value\":2.58,\"display\":\"$2.58\"},\"price_override_firm\":false,\"publish_date\":\"2022-04-20\",\"remixers\":[],\"slug\":\"hope-dies-last\",\"track_count\":2,\"upc\":\"5057272806231\",\"updated\":\"2022-04-20T00:09:44-06:00\",\"url\":\"https://api-internal.beatportprod.com/v4/catalog/releases/3690041/\",\"is_hype\":false},{\"artists\":[{\"id\":1002384,\"image\":{\"id\":31560385,\"uri\":\"https://geo-media.beatport.com/image_size/590x404/65b4debc-eb68-45a6-8b35-9c090c694232.jpg\",\"dynamic_uri\":</html>";
let substitution = "$2\\t$1\\t$3\\t$4\\n";
// 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/