Documentation ¶
Overview ¶
Package regexp2 implements regular expression engine.
Index ¶
- Constants
- func Compile(expr string, regexType RegexType) (regex *regexp.Regexp, err error)
- func DumpDebug(writer io.Writer, data []byte, nBits, nNodes, nGroups int, regex string)
- func IsSupported(expr string) error
- func PrettyStrForDot(str string) string
- type DFA
- type DFAStore
- func (store *DFAStore) Dot() *Graphviz
- func (store *DFAStore) HasRLZA() bool
- func (store *DFAStore) HasUnicodeEdge() bool
- func (store *DFAStore) HasUnicodeWildcard() (present bool, wildcardRange symbolRangeT)
- func (store *DFAStore) IsTrivial() (trivial, accept bool)
- func (store *DFAStore) MergeEdgeRanges(discardRLZ bool)
- func (store *DFAStore) NumberOfNodes() int
- type DataStructures
- type DsLarge
- type DsTiny
- type Graphviz
- type NFAStore
- type RegexType
Constants ¶
const MaxCharInRegex = 1000
MaxCharInRegex is the maximum number of characters in a regex string
const MaxNodesAutomaton = 3000
MaxNodesAutomaton is the maximum number of states when constructing and transforming NFAs and DFAs.
Variables ¶
This section is empty.
Functions ¶
func IsSupported ¶
IsSupported determines whether expr is a supported regex; return nil if supported, error otherwise
func PrettyStrForDot ¶
PrettyStrForDot makes the string pretty and usable for printing in dot files
Types ¶
type DFAStore ¶
type DFAStore struct {
// contains filtered or unexported fields
}
func CompileDFADebug ¶
func (*DFAStore) HasRLZA ¶
HasRLZA returns whether this automaton contains at least one node with a Remaining Length Zero Assertion (RLZA) '$'
func (*DFAStore) HasUnicodeEdge ¶
HasUnicodeEdge returns true if the store has an edge with a non-ASCII unicode symbol excluding a unicode wildcard edge.
func (*DFAStore) HasUnicodeWildcard ¶
HasUnicodeWildcard returns true if the DFA has at least one wildcard edge for ALL non-ASCII values, and all other edges are ASCII observations (thus no regular non-ASCII edges)
func (*DFAStore) IsTrivial ¶
IsTrivial return whether the DFA is a trivial automation; if the DFA is trivial, accept indicate whether the DFA always accepts or always rejects
func (*DFAStore) MergeEdgeRanges ¶
func (*DFAStore) NumberOfNodes ¶
NumberOfNodes return the number of nodes in this automaton
type DataStructures ¶
type DsLarge ¶
type DsLarge struct {
// contains filtered or unexported fields
}
DsLarge is a data structure for the large DFA implementation
func NewDsLarge ¶
NewDsLarge creates a data structure that is accepted by the large DFA
type DsTiny ¶
type DsTiny struct { Store *DFAStore // contains filtered or unexported fields }
func (*DsTiny) Data ¶
func (d *DsTiny) Data(nBits int, hasUnicodeWildcard bool, wildcardRange symbolRangeT) ([]byte, bool)
Data creates the data-structure with the provided parameters
func (*DsTiny) DataWithGraphviz ¶
func (*DsTiny) NumberOfGroups ¶
type Graphviz ¶
type Graphviz struct {
// contains filtered or unexported fields
}