3+ results for 'email address regex lang:rust' (91 ms)
24/// 25/// For example, consider regular expressions to match email addresses and 26/// domains: `[a-z]+@[a-z]+\.(com|org|net)` and `[a-z]+\.(com|org|net)`. If a 26/// domains: `[a-z]+@[a-z]+\.(com|org|net)` and `[a-z]+\.(com|org|net)`. If a 27/// regex set is constructed from those regexes, then searching the text 28/// `foo@example.com` will report both regexes as matching. Of course, one 37/// 38/// This shows how the above two regexes (for matching email addresses and 39/// domains) might work: 46/// ```text 47/// (?P<email>[a-z]+@(?P<email_domain>[a-z]+[.](com|org|net)))|(?P<domain>[a-z]+[.](com|org|net)) 48/// ``` 424/// ```rust 425/// # use regex::RegexSet; 426/// let set = RegexSet::new(&[re_set.rs https://bitbucket.org/vionika/spin.android.git | Rust | 411 lines
31/// expressions in the set match. Indeed, this is the key difference between 32/// regex sets and a single `Regex` with many alternates, since only one 33/// alternate can match at a time. 34/// 35/// For example, consider regular expressions to match email addresses and 36/// domains: `[a-z]+@[a-z]+\.(com|org|net)` and `[a-z]+\.(com|org|net)`. If a 36/// domains: `[a-z]+@[a-z]+\.(com|org|net)` and `[a-z]+\.(com|org|net)`. If a 37/// regex set is constructed from those regexes, then searching the text 38/// `foo@example.com` will report both regexes as matching. Of course, one 47/// 48/// This shows how the above two regexes (for matching email addresses and 49/// domains) might work: 81/// 82/// A `RegexSet` has the same performance characteristics as `Regex`. Namely, 83/// search takes `O(mn)` time, where `m` is proportional to the size of there_set.rs https://bitbucket.org/vionika/spin.android.git | Rust | 431 lines
47/// 48/// This shows how the above two regexes (for matching email addresses and 49/// domains) might work: 165 /// ```rust 166 /// # use regex::RegexSet; 167 /// let set = RegexSet::new(&[ 364 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 365 write!(f, "RegexSet({:?})", self.0.regex_strings()) 366 } 380/// ```rust 381/// # use regex::RegexSet; 382/// let set = RegexSet::new(&[ 409/// ```rust 410/// # use regex::bytes::RegexSet; 411/// let set = RegexSet::new(&[