// 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)^[\p{Cyrillic}0-9\s-#$%^&\\]+$").unwrap();
let string = "1 Май
-
Май 25\\5
Ӑ ӑ
Ӓ ӓ
Ә ә
Ӛ ӛ
Ӕ ӕ
Б б
В в
Г г
Ґ ґ
Ѓ ѓ
Ғ ғ
Ӷ ӷ
Ҕ ҕ
Д д
Ђ ђ
Е е
Ѐ ѐ
Ё ё
Ӗ ӗ
Ҽ ҽ
Ҿ ҿ
Є є
Ж ж
Ӂ ӂ
Җ җ
Ӝ ӝ
З з
З́ з́
Ҙ ҙ
Ӟ ӟ
Ӡ ӡ
Ѕ ѕ
И и
Ѝ ѝ
Ӥ ӥ
Ӣ ӣ
І і
Ї ї
Ӏ ӏ
Й й
Ҋ ҋ
Ј ј
К к
Қ қ
Ҟ ҟ
Ҡ ҡ
Ӄ ӄ
Ҝ ҝ
Л л
Ӆ ӆ
Љ љ
М м
Ӎ ӎ
Н н
Ӊ ӊ
Ң ң
Ӈ ӈ
Ҥ ҥ
Њ њ
О о
Ӧ ӧ
Ө ө
Ӫ ӫ
Ҩ ҩ
П п
Ҧ ҧ
Р р
Ҏ ҏ
С с
С́ с́
Ҫ ҫ
Т т
Ҭ ҭ
Ћ ћ
Ќ ќ
У у
Ў ў
Ӳ ӳ
Ӱ ӱ
Ӯ ӯ
Ү ү
Ұ ұ
Ф ф
Х х
Ҳ ҳ
Һ һ
Ц ц
Ҵ ҵ
Ч ч
Ӵ ӵ
Ҷ ҷ
Ӌ ӌ
Ҹ ҹ
Џ џ
Ш ш
Щ щ
Ъ ъ
Ы ы
Ӹ ӹ
Ь ь
Ҍ ҍ
Э э
Ӭ ӭ
Ю ю
Я я
abcdefgh
012344";
// 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/