// 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)@[\h\pL]+\(([^)]+)\)\h\{([^}]+)\}\K").unwrap(); let string = "@loop (<ВЗЯТЬ ПЕРВЫЙ ТЕКCТ>) {<