The goal is to use a regex to remove text between the nth and the next comma in rust.
For example outside of rust I would use
^((?:.*?,){4})[^,]*,(.*)$
on London, City of Westminster, Greater London, England, SW1A 2DX, United Kingdom
to get a desired result like:
London, City of Westminster, Greater London, England, United Kingdom
I don't have a strong understanding of regex in general unfortunately. So I would learn more about the mechanic and be able to use it in the program I'm writing to learn rust. Just copy pasting it ala
let string = "London, City of Westminster, Greater London, England, United Kingdom"
let re = Regex::new(r"^((?:.*?,){4})[^,]*,(.*)$").unwrap();
re.replace(string, "");
is not working obviously.