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

Function RegexProgramSizeLimit

cel/options.go:1036–1051  ·  view source on GitHub ↗

RegexProgramSizeLimit caps the maximum regex program plan size permitted for regular expressions. A negative or zero value means unbounded.

(limit int)

Source from the content-addressed store, hash-verified

1034// RegexProgramSizeLimit caps the maximum regex program plan size permitted for regular expressions.
1035// A negative or zero value means unbounded.
1036func RegexProgramSizeLimit(limit int) EnvOption {
1037 return func(e *Env) (*Env, error) {
1038 var err error
1039 e, err = setLimit(limitRegexProgramSize, limit)(e)
1040 if err != nil {
1041 return nil, err
1042 }
1043 if limit > 0 {
1044 e, err = ASTValidators(ValidateRegexProgramSizeLimit(limit))(e)
1045 if err != nil {
1046 return nil, err
1047 }
1048 }
1049 return e, nil
1050 }
1051}
1052
1053// EnableHiddenAccumulatorName sets the parser to use the identifier '@result' for accumulators
1054// which is not normally accessible from CEL source.

Callers 2

Calls 3

setLimitFunction · 0.85
ASTValidatorsFunction · 0.85

Tested by 2