def perform_replacement(entity, mapping_list):
    """Perform a replacement on the value of an entity using a replacement mapping, if applicable."""
    if not entity.value:
        return
    entity_value = entity.value
    for mapping_dict in mapping_list:
        if 'search_string' in mapping_dict.keys():
            search_string = mapping_dict['search_string']
            replacement = mapping_dict['replacement']
            if search_string in entity_value:
                entity.value = entity_value.replace(search_string, replacement)
        if 'regex' in mapping_dict.keys():
            compiled_regex = mapping_dict['regex']
            replacement = mapping_dict['replacement']
            if compiled_regex.search(entity_value):
                entity.value = compiled_regex.sub(replacement, entity_value)
