Enum magic_regexp::Type
source · pub enum Type {
Show 24 variants
Digit,
NotDigit,
WordBoundary,
NotWordBoundary,
Word,
WordChar,
NotWordChar,
Text(String),
Options(String),
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.