Macro lazy_regex_proc_macros::regex_find

source ยท
regex_find!() { /* proc-macro */ }
Expand description

Extract the leftmost match of the regex in the second argument, as a &str, or a &[u8] if the B flag is set.

Example:

let f_word = regex_find!(r#"\bf\w+\b"#, "The fox jumps.");
assert_eq!(f_word, Some("fox"));
let f_word = regex_find!(r#"\bf\w+\b"#B, "The forest is silent.");
assert_eq!(f_word, Some(b"forest" as &[u8]));