MCPcopy Create free account
hub / github.com/cel-expr/cel-go / OptimizeRegex

Function OptimizeRegex

cel/options.go:576–581  ·  view source on GitHub ↗

OptimizeRegex provides a way to replace the InterpretableCall for regex functions. This can be used to compile regex string constants at program creation time and report any errors and then use the compiled regex for all regex function invocations.

(regexOptimizations ...*interpreter.RegexOptimization)

Source from the content-addressed store, hash-verified

574// to compile regex string constants at program creation time and report any errors and then use the
575// compiled regex for all regex function invocations.
576func OptimizeRegex(regexOptimizations ...*interpreter.RegexOptimization) ProgramOption {
577 return func(p *prog) (*prog, error) {
578 p.regexOptimizations = append(p.regexOptimizations, regexOptimizations...)
579 return p, nil
580 }
581}
582
583// ConfigOptionFactory declares a signature which accepts a configuration element, e.g. env.Extension
584// and optionally produces an EnvOption in response.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected