• Home
  • Raw
  • Download

Lines Matching full:regex

3 use regex;
11 // regex and the input. Other dynamic tests explicitly set the engine to use.
14 use regex::Regex;
15 Regex::new($re)
19 macro_rules! regex { macro
27 use regex::RegexSet;
66 assert!(regex::Regex::new(r"(?-u)\xFF").is_err()); in disallow_non_utf8()
67 assert!(regex::Regex::new(r"(?-u).").is_err()); in disallow_non_utf8()
68 assert!(regex::Regex::new(r"(?-u)[\xFF]").is_err()); in disallow_non_utf8()
69 assert!(regex::Regex::new(r"(?-u)☃").is_err()); in disallow_non_utf8()
74 assert!(regex::Regex::new(r"\0").is_err()); in disallow_octal()
79 assert!(regex::RegexBuilder::new(r"\0").octal(true).build().is_ok()); in allow_octal()
84 use regex::bytes; in oibits()
85 use regex::{Regex, RegexBuilder, RegexSet, RegexSetBuilder}; in oibits()
93 assert_send::<Regex>(); in oibits()
94 assert_sync::<Regex>(); in oibits()
95 assert_unwind_safe::<Regex>(); in oibits()
96 assert_ref_unwind_safe::<Regex>(); in oibits()
102 assert_send::<bytes::Regex>(); in oibits()
103 assert_sync::<bytes::Regex>(); in oibits()
104 assert_unwind_safe::<bytes::Regex>(); in oibits()
105 assert_ref_unwind_safe::<bytes::Regex>(); in oibits()
130 // See: https://github.com/rust-lang/regex/issues/568
133 use regex::Regex; in oibits_regression()
136 let _ = panic::catch_unwind(|| Regex::new("a").unwrap()); in oibits_regression()
139 // See: https://github.com/rust-lang/regex/issues/750
145 use regex::bytes; in regex_is_reasonably_small()
146 use regex::{Regex, RegexSet}; in regex_is_reasonably_small()
148 assert_eq!(16, size_of::<Regex>()); in regex_is_reasonably_small()
150 assert_eq!(16, size_of::<bytes::Regex>()); in regex_is_reasonably_small()
154 // See: https://github.com/rust-lang/regex/security/advisories/GHSA-m5pq-gvj9-9vr8
157 // We test that our regex compiler will correctly return a "too big" error when
160 // At the time this test was written, the regex compiler does not represent
163 // to an unconditional JUMP in the regex bytecode (i.e., an unconditional
166 // doesn't actually contribute any additional memory to the compiled regex
172 // do nothing for a decently large amount of time. It causes the regex to take
173 // quite a bit of time to compile, despite the concrete syntax of the regex
182 // This particular test is somewhat narrow. It merely checks that regex
184 // fix landed, this test would eventually fail because the regex would be
190 use regex::Regex; in big_empty_regex_fails()
192 let result = Regex::new("(?:){4294967295}"); in big_empty_regex_fails()
199 use regex::Regex; in big_empty_reps_chain_regex_fails()
201 let result = Regex::new("(?:){64}{64}{64}{64}{64}{64}"); in big_empty_reps_chain_regex_fails()
209 use regex::Regex; in big_zero_reps_regex_fails()
211 let result = Regex::new(r"x{0}{4294967295}"); in big_zero_reps_regex_fails()
218 use regex::Regex; in empty_alt_regex_fails()
220 let result = Regex::new(r"(?:|){4294967295}"); in empty_alt_regex_fails()