[−][src]Enum regex_syntax::ErrorKind
The specific type of parse error that can occur.
Variants
A negation symbol is used twice in flag settings.
e.g., (?-i-s)
.
DuplicateCaptureName(String)
The same capture name was used more than once.
e.g., (?P<a>.)(?P<a>.)
.
An alternate is empty. e.g., (|a)
.
A capture group name is empty. e.g., (?P<>a)
.
A negation symbol was not proceded by any flags. e.g., (?i-)
.
A group is empty. e.g., ()
.
InvalidBase10(String)
An invalid number was used in a counted repetition. e.g., a{b}
.
InvalidBase16(String)
An invalid hexadecimal number was used in an escape sequence.
e.g., \xAG
.
InvalidCaptureName(String)
An invalid capture name was used. e.g., (?P<0a>b)
.
An invalid class range was givien. Specifically, when the start of the
range is greater than the end. e.g., [z-a]
.
Fields of InvalidClassRange
InvalidClassEscape(Expr)
An escape sequence was used in a character class where it is not
allowed. e.g., [a-\pN]
or [\A]
.
An invalid counted repetition min/max was given. e.g., a{2,1}
.
Fields of InvalidRepeatRange
InvalidScalarValue(u32)
An invalid Unicode scalar value was used in a long hexadecimal
sequence. e.g., \x{D800}
.
An empty counted repetition operator. e.g., a{}
.
A repetition operator was not applied to an expression. e.g., *
.
RepeaterUnexpectedExpr(Expr)
A repetition operator was applied to an expression that cannot be
repeated. e.g., a+*
or a|*
.
UnclosedCaptureName(String)
A capture group name that is never closed. e.g., (?P<a
.
An unclosed hexadecimal literal. e.g., \x{a
.
An unclosed parenthesis. e.g., (a
.
An unclosed counted repetition operator. e.g., a{2
.
An unclosed named Unicode class. e.g., \p{Yi
.
Saw end of regex before class was closed. e.g., [a
.
Saw end of regex before escape sequence was closed. e.g., \
.
Saw end of regex before flags were closed. e.g., (?i
.
Saw end of regex before two hexadecimal digits were seen. e.g., \xA
.
Unopened parenthesis. e.g., )
.
UnrecognizedEscape(char)
Unrecognized escape sequence. e.g., \q
.
UnrecognizedFlag(char)
Unrecognized flag. e.g., (?a)
.
UnrecognizedUnicodeClass(String)
Unrecognized named Unicode class. e.g., \p{Foo}
.
Indicates that the regex uses too much nesting.
(N.B. This error exists because traversing the Expr is recursive and an explicit heap allocated stack is not (yet?) used. Regardless, some sort of limit must be applied to avoid unbounded memory growth.
FlagNotAllowed(char)
A disallowed flag was found (e.g., u
).
A Unicode class was used when the Unicode (u
) flag was disabled.
InvalidUtf8 indicates that the expression may match non-UTF-8 bytes. This never returned if the parser is permitted to allow expressions that match arbitrary bytes.
A character class was constructed such that it is empty.
e.g., [^\d\D]
.
UnsupportedClassChar(char)
Indicates that unsupported notation was used in a character class.
The char in this error corresponds to the illegal character.
The intent of this error is to carve a path to support set notation as described in UTS#18 RL1.3. We do this by rejecting regexes that would use the notation.
The work around for end users is to escape the character included in this error message.
Trait Implementations
impl Clone for ErrorKind
[src]
impl PartialEq<ErrorKind> for ErrorKind
[src]
impl Display for ErrorKind
[src]
impl Debug for ErrorKind
[src]
impl StructuralPartialEq for ErrorKind
[src]
Auto Trait Implementations
impl Send for ErrorKind
impl Sync for ErrorKind
impl Unpin for ErrorKind
impl UnwindSafe for ErrorKind
impl RefUnwindSafe for ErrorKind
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,