Skip to content
FutureBlitz

    Install

    Import std.text.regex

    RegexError

    std.text.regex

    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)

    std/text/regex.fb, line 69

    • Public ReadOnly Field Kind: RegexErrorKind field #

      What kind of RegexError it is.

    • Public ReadOnly Field Offset: Int field #

      The byte offset in the pattern of what isn't valid, or in the text of where the match started looking.

    • Public New(kind: RegexErrorKind, message: String, offset: Int, cause: Error? = Null) constructor #

      A RegexError of kind that says message, at offset.

    Report an issue with this page or with FutureBlitz on GitHub.