Enum magic_regexp::Type
source · pub enum Type<'a> {
Show 24 variants
Digit,
NotDigit,
WordBoundary,
NotWordBoundary,
Word,
WordChar,
NotWordChar,
Text(&'a str),
Options(&'a str),
Char,
Whitespace,
NotWhitespace,
Letter,
NotLetter,
LetterLowercase,
NotLetterLowercase,
LetterUppercase,
NotLetterUppercase,
Tab,
NotTab,
Linefeed,
NotLinefeed,
CarriageReturn,
NotCarriageReturn,
}
Expand description
Represents a regex type. This enum is used to create the smallest regex statement.
For example, Type::Digit
will create the regex \d
.
§Examples
use magic_regexp::{OneOrMore, Type::Digit};
let input = OneOrMore(Digit);
assert_eq!(input.to_string(), r"(\d+)"); // Note that the regex is wrapped in parentheses.
Variants§
Digit
NotDigit
WordBoundary
NotWordBoundary
Word
WordChar
NotWordChar
Text(&'a str)
Options(&'a str)
Char
Whitespace
NotWhitespace
Letter
NotLetter
LetterLowercase
NotLetterLowercase
LetterUppercase
NotLetterUppercase
Tab
NotTab
Linefeed
NotLinefeed
CarriageReturn
NotCarriageReturn
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Type<'a>
impl<'a> RefUnwindSafe for Type<'a>
impl<'a> Send for Type<'a>
impl<'a> Sync for Type<'a>
impl<'a> Unpin for Type<'a>
impl<'a> UnwindSafe for Type<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more