def default_replace(row, target, *pattern_repl):
    """
    Replaces the pattern in the target string with a given string. The pattern
    can be either a string or regular expression, if a regular expression is
    used groups can be used in the replacement string.

    :param row: The row being transformed (not used)
    :param target: The value to perform the replacement on
    :param pattern_repl: Any number of parameters that have pattern and
        replacement strings, there should be an even number of elements
        with the 1st, 3rd, 5th etc representing the patterns and teh 2nd,
        4th, 6th ets representing the corresponding replacements

    :return: The transformed object
    """
    result = target
    patterns = (p for i, p in enumerate(pattern_repl) if i % 2 == 0)
    repls = (r for i, r in enumerate(pattern_repl) if i % 2 != 0)

    for pattern, repl in zip(patterns, repls):
        if isinstance(pattern, str):
            result = str(result).replace(pattern, repl)
        else:
            result = pattern.sub(repl, str(result))

    return result