// 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)(?:\b[A-Z]{2,3}\s*[$€£¥₣₹]?|[$€£¥₣₹])\s*\d+(?:\.\d+)?(?:\s*(?:K|[BM](?:illions?)?)\b)?").unwrap();
let string = "Company Fragile9 Closes €9M Series B Funding
Appplle21 Receives CAD$17.5K in Equity Financing
Cat Raises $10.8 Millions in Series A Funding
Sun Raises EUR35M in Funding at a $1 Billion Valuation
Japan1337 Announces JPY 1.78 Billion Funding Round";
// result will be an iterator over tuples containing the start and end indices for each match in the string
let result = regex.captures_iter(string);
for mat in result {
println!("{:?}", mat);
}
}
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/