regexp正则表达式

go正则表达式 #

go内置正则表达式包为 regexp

https://pkg.go.dev/regexp?tab=doc
https://studygolang.com/static/pkgdoc/pkg/regexp.htm
https://studygolang.com/pkgdoc
https://golang.org/pkg/regexp/

regexp包常用方法 #

返回Regexp结构体指针
func Compile(expr string) (*Regexp, error)
func CompilePOSIX(expr string) (*Regexp, error)
func MustCompile(str string) *Regexp
func MustCompilePOSIX(str string) *Regexp

func MatchString(pattern string, s string) (matched bool, err error)
func Match(pattern string, b []byte) (matched bool, err error)
func MatchReader(pattern string, r io.RuneReader) (matched bool, err error)

func QuoteMeta(s string) string

Build by Loppo 0.6.15