std/regex/syntax

std/regex/src/syntax.trb

The syntax of a pattern: RE2's, read into a tree of RegexNodes. What RE2 does not have - backreferences and lookaround - is refused with a message that says so, because a regular expression here runs in time linear in its input.

type RegexError

type RegexError with Show, Error

Why a text is not a regular expression: what is wrong, and the byte offset in the pattern where it was found.

field pattern

pattern: String

The whole pattern that was refused.

field offset

offset: Int

The byte offset in pattern where the problem was found.

field message

message: String

What is wrong, in words.

fn show

fn show(): String

The pattern in backticks, the message and the byte offset, as one sentence.