Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Inst ¶
type Inst struct {
Op OpCode
Out int // primary successor
Out1 int // secondary successor (for InstSplit)
Rune rune // for InstRune
Ranges []Range // for InstRuneClass
UnicodeTable interface{} // *unicode.RangeTable for Unicode property classes
Cap int // for InstCapStart/End
Ref int // for InstBackref
Greedy bool // for InstSplit: prefer Out (greedy) vs Out1 (lazy)
Negated bool // for InstRuneClass: negated class
CaseInsensitive bool // for InstRune/InstRuneClass: (?i) mode
}
type OpCode ¶
type OpCode int
const ( InstRune OpCode = iota // match single rune InstRuneClass // match rune against ranges InstAnyNotNL // match any char except \n InstAnyChar // match any char (dotall) InstSplit // NFA split: try Out and Out1 InstJump // unconditional jump to Out InstMatch // successful match InstFail // forced failure InstCapStart // begin capture group InstCapEnd // end capture group InstBeginLine // ^ InstEndLine // $ InstBeginText // \A InstEndText // \z InstWordBoundary // \b InstNoWordBoundary // \B InstLookaheadStart // begin lookahead InstLookaheadEnd // end lookahead InstLookbehindStart // begin lookbehind InstLookbehindEnd // end lookbehind InstBackref // match captured group content InstAtomicStart // begin atomic group InstAtomicEnd // end atomic group )
type Program ¶
type Program struct {
Insts []Inst
Start int
NumCap int
CapNames map[string]int
NeedsBacktrack bool
NeedsLookaround bool
HasAnchors bool
AnchoredStart bool // pattern starts with ^ or \A
OnlyStartAnchor bool // only anchor is ^ at start (safe for DFA)
IsLiteral bool
LiteralPrefix string
PrefixComplete bool
}
func (*Program) HasWordBoundary ¶
Click to show internal directories.
Click to hide internal directories.