def Substitute(pattern, repl, text):
  if not re.search(pattern, text):
    raise NoMatchError('No match for pattern "{0}" in "{1}"'.format(
        pattern, text))
  return re.sub(pattern, repl, text)
Substitute all 'pattern' in 'text' with 'repl'.
dataset/ETHPy150Open GoogleCloudPlatform/PerfKitBenchmarker/perfkitbenchmarker/regex_util.py/Substitute