// 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+,]{,100})").unwrap();
let string = "Ваша ассоциация наняла рабочего Стэнфорд Флеминг за $208,000,000. Основным соперником была ассоциация Путь со ставкой $195,440,000.
Следующие игроки приняли участие в аукционе:
DikoBrazzers: $28,450,000
рус73: $27,880,000
TANK1515: $20,110,000
Крысолов: $20,000,000
Валентинович 55: $19,860,000
Slepoy 16ru: $15,000,000
Виктор 74: $13,680,000
корефанец: $10,850,000
Папа Djo: $10,210,000
Кадима: $10,020,000
Aleks Mechanic: $9,410,000
пожик47: $9,300,000
super_skif: $7,590,000
Лoки: $5,640,000";
// 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/