// 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)(?:^|, )\d+(?=\s*[A-Z])").unwrap();
let string = "1John Radcliffe Hospital/Oxford/United Kingdom, 11Ruhr-Universität
3/Bochum/Bochum/Germany, 3University of British Columbia/Vancouver/Canada, 4National
Institute of Neuroscience, National Center of Neurology and Psychiatry/Tokyo/Japan,
5University of Catania/Catania/Italy, 6F. Hoffmann-La Roche Ltd/Basel/Switzerland, 7
University of Colorado School of Medicine/Aurora/United States of America";
let substitution = "\\g<0>=";
// 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/