// 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)(\<li\>\<a target.+?\>)(.+)(\<\/a\>\<\/li\>)").unwrap();
let string = "Функция Blue
Функция ChrW [VBA]
Функция CreateUnoDialog
Функция CurDir
Функция Дата
Функция DateSerial
Функция DateValue
Функция Day
Функция DDB [VBA]
Функция Dir
Функция Eof
Функции обработки ошибок
Функция FileAttr
Функция FileDateTime
Функция FileExists
Функция FileLen
Функция FormatDateTime [VBA]
Функция FormatNumber [VBA]
Функция FreeFile
Функция FV [VBA]
Функция GetAttr
Функция Green
Функция InStrRev [VBA]
Функция Input [VBA]
Функция InputBox
Функция IPmt [VBA]
Функция IRR [VBA]
Функция Loc
Функция Lof
Функция MIRR [VBA]
Функция Month
Функция MonthName [VBA]
Функция NPer [VBA]
Функция NPV [VBA]
Числовые функции
Функция Pmt [VBA]
Функция PPmt [VBA]
Функция PV [VBA]
Функция QBColor
Функция Rate [VBA]
Функция Red
Функция RGB
Функция RGB [VBA]
Функция Round [VBA]
Функция Seek
Функция SLN [VBA]
Функция StrConv [VBA]
Функция StrReverse [VBA]
Функция SYD [VBA]
Функция WeekDay
Функция WeekdayName [VBA]";
let substitution = "$2";
// 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/