regex

package
v2.8.8 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: Apache-2.0 Imports: 1 Imported by: 4

Documentation

Index

Constants

View Source
const (
	RE2       = "RE2"
	Oniguruma = "Oniguruma"
)
View Source
const Name = RE2

Variables

This section is empty.

Functions

func QuoteMeta

func QuoteMeta(s string) string

Types

type EnryRegexp

type EnryRegexp = *regexp.Regexp

func MustCompile

func MustCompile(str string) EnryRegexp

func MustCompileMultiline added in v2.8.4

func MustCompileMultiline(s string) EnryRegexp

MustCompileMultiline mimics Ruby defaults for regexp, where ^$ matches begin/end of line. I.e. it converts Ruby regexp syntaxt to RE2 equivalent

func MustCompileRuby added in v2.8.4

func MustCompileRuby(s string) EnryRegexp

MustCompileRuby used for expressions with syntax not supported by RE2. Now it's confusing as we use the result as data/rule.Matcher and

(*Matcher)(nil) != nil

What is a better way for an expression to indicate unsupported syntax? e.g. add .IsValidSyntax() to both, Matcher interface and EnryRegexp implementations?

Jump to

Keyboard shortcuts

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