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

Function regexExtractAllCostModel

ext/regex.go:414–420  ·  view source on GitHub ↗

regexExtractAllCostModel models regex.extractAll: it returns parts of the target, sized as the parts of a split.

(id string)

Source from the content-addressed store, hash-verified

412// regexExtractAllCostModel models regex.extractAll: it returns parts of the target, sized as the
413// parts of a split.
414func regexExtractAllCostModel(id string) cost.OverloadModel {
415 return cost.Overload(id,
416 cost.EvalCost(cost.AllocList(regexSearch(cost.Arg(0), cost.Arg(1)), cost.Length(cost.Result()))),
417 cost.ResultSize(splitSize(cost.Arg(0))),
418 cost.BeforeVersion(1, cost.ManualEstimator(estimateExtractAllCost)),
419 )
420}
421
422// regexReplaceCostModel models regex.replace: it may expand each of the at most n + 1 matches into
423// the replacement, whose capture group references may each expand to the whole target.

Callers 1

CompileOptionsMethod · 0.85

Calls 11

OverloadFunction · 0.92
EvalCostFunction · 0.92
AllocListFunction · 0.92
ArgFunction · 0.92
LengthFunction · 0.92
ResultFunction · 0.92
ResultSizeFunction · 0.92
BeforeVersionFunction · 0.92
ManualEstimatorFunction · 0.92
regexSearchFunction · 0.85
splitSizeFunction · 0.85

Tested by

no test coverage detected