[][src]Struct grex::RegExpBuilder

pub struct RegExpBuilder { /* fields omitted */ }

This struct builds regular expressions from user-provided test cases.

Methods

impl RegExpBuilder[src]

pub fn from<T: Clone + Into<String>>(test_cases: &[T]) -> Self[src]

Specifies the test cases to build the regular expression from. The test cases may be passed as a shared slice &[T] where T may represent anything that can be converted to a String.

Note: The test cases do not have to be sorted because RegExpBuilder will sort them for you.

pub fn with_escaped_non_ascii_chars(
    &mut self,
    use_surrogate_pairs: bool
) -> &mut Self
[src]

Tells RegExpBuilder to convert non-ASCII characters to unicode escape sequences. The parameter use_surrogate_pairs specifies whether to convert astral code planes (range U+010000 to U+10FFFF) to surrogate pairs.

pub fn with_converted_repetitions(&mut self) -> &mut Self[src]

Tells RegExpBuilder to detect repeated non-overlapping substrings and to convert them to {min,max} quantifier notation.

pub fn build(&mut self) -> String[src]

Builds the actual regular expression using the previously given settings. Every generated regular expression is surrounded by the anchors ^ and $ so that substrings not being part of the test cases are not matched accidentally.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.