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