#[non_exhaustive]pub enum ErrorKind {
Show 37 variants
MissingRepetition,
UnfinishedRepetition,
EmptyDecimal,
InvalidDecimal,
EmptyHex,
InvalidHex,
NonUnicodeHex,
InvalidRepetitionRange,
UnfinishedEscape,
UnsupportedBackref,
UnsupportedEscape,
UnfinishedWordBoundary,
UnknownWordBoundary,
UnicodeClassesNotSupported,
LookaroundNotSupported,
UnfinishedCaptureName,
EmptyCaptureName,
InvalidCaptureName,
NonAsciiCaptureName,
DuplicateCaptureName {
prev_pos: Range<usize>,
},
UnfinishedGroup,
NonMatchingGroupEnd,
UnfinishedSet,
InvalidRangeStart,
InvalidRangeEnd,
InvalidRange,
InvalidEscapeInSet,
UnfinishedFlags,
UnfinishedFlagsNegation,
RepeatedFlagNegation,
UnsupportedFlag,
RepeatedFlag {
contradicting: bool,
},
DisallowedWhitespace,
DisallowedComment,
AstOverflow,
GroupDepthOverflow,
NamedGroupOverflow,
}Expand description
Kind of a regex validation Error.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MissingRepetition
Missing node for repetition, e.g. in *.
UnfinishedRepetition
Unfinished repetition, e.g. in .{.
EmptyDecimal
Empty decimal in a counted repetition, e.g. in .{}.
InvalidDecimal
Invalid decimal in a counted repetition, e.g. in .{2x}.
EmptyHex
Empty hexadecimal escape, e.g. \x{}.
InvalidHex
Invalid hexadecimal escape, e.g. \u{what}.
NonUnicodeHex
Hexadecimal escape does not map to a Unicode char, e.g. \U99999999.
InvalidRepetitionRange
Invalid counted repetition range, e.g. in .{3,2}.
UnfinishedEscape
Unfinished escape, e.g. \u1.
UnsupportedBackref
Backreferences, e.g. \1, are not supported (same as in the regex crate).
UnsupportedEscape
Unsupported escape, e.g. \Y.
UnfinishedWordBoundary
Unfinished word boundary, e.g. \b{start.
UnknownWordBoundary
Unknown word boundary, e.g. \b{what}.
UnicodeClassesNotSupported
Unicode classes like \pN or \p{Digit} are not supported.
LookaroundNotSupported
Lookaround groups are not supported (same as in the regex crate).
UnfinishedCaptureName
Unfinished capture name, e.g. in (?<what.
EmptyCaptureName
Empty capture name, e.g. in (?P<>.).
InvalidCaptureName
Invalid capture name, e.g. in (?< what >.).
NonAsciiCaptureName
Non-ASCII chars in the capture name.
DuplicateCaptureName
Duplicate capture name, e.g., in (?<test>.)(?<test>.).
UnfinishedGroup
Unfinished group, e.g. in (..
NonMatchingGroupEnd
Non-matching group end, e.g. in (.)).
UnfinishedSet
Unfinished set, e.g. in [0-9.
InvalidRangeStart
Invalid set range start, e.g. in [\d-9] (\d doesn’t correspond to a single char).
InvalidRangeEnd
Invalid set range end, e.g. in [0-\D] (\D doesn’t correspond to a single char).
InvalidRange
Invalid range, e.g., in [9-0].
InvalidEscapeInSet
Invalid escape encountered in a character set, e.g. in [0\b] (\b is an assertion, it doesn’t map to a char
or a set of chars).
UnfinishedFlags
Unfinished flags, e.g., (?x.
UnfinishedFlagsNegation
Unfinished negation in flags, e.g. (?-).
RepeatedFlagNegation
Repeated negation in flags, e.g. (?--x).
UnsupportedFlag
Unsupported flag, e.g. in (?Y).
RepeatedFlag
Repeated flag, e.g. in (?xx).
DisallowedWhitespace
Disallowed whitespace, e.g. in \u{1 2 3}. This is technically supported by regex,
but makes literals harder to read.
DisallowedComment
Disallowed comment, e.g.
\U{1# one!
23}This is technically supported by regex, but makes literals harder to read.
AstOverflow
Regex contains too many spans for the capacity specified in RegexOptions::parse() etc.
GroupDepthOverflow
Regex contains too deeply nested groups.
NamedGroupOverflow
Regex contains too many named captures / groups.