MCPcopy Create free account
hub / github.com/OpenSparseLLMs/MoM / regex_replace

Function regex_replace

lm-eval-harness/lm_eval/utils.py:415–417  ·  view source on GitHub ↗

Implements the `re.sub` function as a custom Jinja filter.

(string, pattern, repl, count: int = 0)

Source from the content-addressed store, hash-verified

413
414
415def regex_replace(string, pattern, repl, count: int = 0):
416 """Implements the `re.sub` function as a custom Jinja filter."""
417 return re.sub(pattern, repl, string, count=count)
418
419
420env = Environment(loader=BaseLoader, undefined=StrictUndefined)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected