regexExtractAllCostModel models regex.extractAll: it returns parts of the target, sized as the parts of a split.
(id string)
| 412 | // regexExtractAllCostModel models regex.extractAll: it returns parts of the target, sized as the |
| 413 | // parts of a split. |
| 414 | func 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. |
no test coverage detected