summaryrefslogtreecommitdiffstats
path: root/src/regex.rs
blob: 5e38c819bcecc7d6c051b6487f17898f2e184945 (plain) (blame)
1
2
3
4
5
6
7
8
#[macro_export]
macro_rules! regex_captures {
    ($rx:expr, $s:expr $(,)?) => {{
        static RX: once_cell::sync::Lazy<regex::Regex> =
            once_cell::sync::Lazy::new(|| regex::Regex::new($rx).unwrap());
        RX.captures($s)
    }};
}