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