Import std.text.regex
RegexError
class
Public Class RegexError Extends Error
A pattern that isn't valid, at the byte Offset of the pattern, or a match that went past a limit, where Offset is where in the text it started looking.
Examples
// A pattern known only as the program runs, like one a user types, is checked then.
Local typed = "(" + "unclosed"
Local error = ExpectThrows<RegexError>(Regex.Parse(typed))
Expect(error?.Kind == RegexErrorKind.PATTERN && error?.Offset == 9)-
What kind of RegexError it is.
-
The byte offset in the pattern of what isn't valid, or in the text of where the match started looking.
-
A RegexError of
kindthat saysmessage, atoffset.
Report an issue with this page or with FutureBlitz on GitHub.