import re


def clean_regex(x, pattern_mapping):
    """ Clean text based on pre-defined regular expressions """
    for old_pattern, new_pattern in pattern_mapping.items():
        x = re.sub(old_pattern, new_pattern, x)
    return x