kubernetes/staging/src/k8s.io/apiserver/pkg/cel/library/regex.go

// Regex provides a CEL function library extension of regex utility functions.
//
// find / findAll
//
// Returns substrings that match the provided regular expression. find returns the first match. findAll may optionally
// be provided a limit. If the limit is set and >= 0, no more than the limit number of matches are returned.
//
//	<string>.find(<string>) <string>
//	<string>.findAll(<string>) <list <string>>
//	<string>.findAll(<string>, <int>) <list <string>>
//
// Examples:
//
//	"abc 123".find('[0-9]*') // returns '123'
//	"abc 123".find('xyz') // returns ''
//	"123 abc 456".findAll('[0-9]*') // returns ['123', '456']
//	"123 abc 456".findAll('[0-9]*', 1) // returns ['123']
//	"123 abc 456".findAll('xyz') // returns []
func Regex() cel.EnvOption {}

var regexLib

type regex

func (*regex) LibraryName() string {}

func (*regex) Types() []*cel.Type {}

func (*regex) declarations() map[string][]cel.FunctionOpt {}

var regexLibraryDecls

func (*regex) CompileOptions() []cel.EnvOption {}

func (*regex) ProgramOptions() []cel.ProgramOption {}

func find(strVal ref.Val, regexVal ref.Val) ref.Val {}

func findAll(args ...ref.Val) ref.Val {}

var FindRegexOptimization

var FindAllRegexOptimization