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

Function RegexProgramSizeLimit

cel/options.go:1213–1228  ·  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

1211// RegexProgramSizeLimit caps the maximum regex program plan size permitted for regular expressions.
1212// A negative or zero value means unbounded.
1213func RegexProgramSizeLimit(limit int) EnvOption {
1214 return func(e *Env) (*Env, error) {
1215 var err error
1216 e, err = setLimit(limitRegexProgramSize, limit)(e)
1217 if err != nil {
1218 return nil, err
1219 }
1220 if limit > 0 {
1221 e, err = ASTValidators(ValidateRegexProgramSizeLimit(limit))(e)
1222 if err != nil {
1223 return nil, err
1224 }
1225 }
1226 return e, nil
1227 }
1228}
1229
1230// EnableHiddenAccumulatorName sets the parser to use the identifier '@result' for accumulators
1231// which is not normally accessible from CEL source.

Callers 2

Calls 3

setLimitFunction · 0.85
ASTValidatorsFunction · 0.85

Tested by 2