// 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)(?<=:|^)(?!.*:)(?=.*([Ee]ur|EUR)).*").unwrap();
let string = "[
\"ERDF : EUR 2.7 million\",
\"ERDF : EUR 961 000\",
\"ERDF: 7 305 000 DKR (+/- EUR 974 000) \",
FEOGA: 40 826 EUR\",
\"49 % of eligible costs\",
\"ERDF contribution: 64%\",
\"FEDER (Objectif 5b 1994-1996) 60 979 euros (400 000 FRF)\",
\"FEDER, Objectif 2, 1994 - 1999: 1 116 000 EUR\",
\"EUR 8.000.000\",
\"EUR 7.200.000\",
\"EUR 4.200.000\",
\"EUR 0.2 million\",
\"EUR 0.6 million\",
\"FEDER: 830 842 euros (5 450 000 FRF)\",
\"EUR 7,220,000,000\",
\"DKR 1 220 000 + DKR 1 380 000 \",
\"GBP 150 000\"
]";
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/