regexast

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RegexAst

type RegexAst struct {
	Len     int
	IsStart bool
	Index   string
	Op      string
	IsRune  bool
	Value   string
}

RegexAst express ast of regex's element. Regex character can detect as isRune = true.

func ParseRegex

func ParseRegex(expr string, mode syntax.Flags) (asts []RegexAst, err error)

ParseRegex parse regexp expression as RE2, and output ast. original is regexp.compile : https://github.com/golang/go/blob/faf187fb8e2ca074711ed254c72ffbaed4383c64/src/regexp/regexp.go#L167-L215

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL