1 #![cfg_attr(feature = "pattern", feature(pattern))] 2 3 macro_rules! regex_new { 4 ($re:expr) => {{ 5 use regex::internal::ExecBuilder; 6 ExecBuilder::new($re).nfa().bytes(true).build().map(|e| e.into_regex()) 7 }}; 8 } 9 10 macro_rules! regex { 11 ($re:expr) => { 12 regex_new!($re).unwrap() 13 }; 14 } 15 16 macro_rules! regex_set_new { 17 ($re:expr) => {{ 18 use regex::internal::ExecBuilder; 19 ExecBuilder::new_many($re) 20 .nfa() 21 .bytes(true) 22 .build() 23 .map(|e| e.into_regex_set()) 24 }}; 25 } 26 27 macro_rules! regex_set { 28 ($res:expr) => { 29 regex_set_new!($res).unwrap() 30 }; 31 } 32 33 // Must come before other module definitions. 34 include!("macros_str.rs"); 35 include!("macros.rs"); 36 37 mod api; 38 mod api_str; 39 mod crazy; 40 mod flags; 41 mod fowler; 42 mod multiline; 43 mod noparse; 44 mod regression; 45 mod replace; 46 mod searcher; 47 mod set; 48 mod suffix_reverse; 49 #[cfg(feature = "unicode")] 50 mod unicode; 51 #[cfg(feature = "unicode-perl")] 52 mod word_boundary; 53 #[cfg(feature = "unicode-perl")] 54 mod word_boundary_unicode; 55