[−][src]Struct grex::RegExpBuilder
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]
&mut self,
use_surrogate_pairs: bool
) -> &mut Self
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
impl RefUnwindSafe for RegExpBuilder
impl Send for RegExpBuilder
impl Sync for RegExpBuilder
impl Unpin for RegExpBuilder
impl UnwindSafe for RegExpBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,