import re


def _regex_replace(pattern, repl, src):
    """Replacing matches in `src` with `repl` using regex `pattern`"""
    print ("config.ini: replacing: '%s' => '%s'" % (pattern, repl))
    return re.sub(pattern, repl, src)