import re


def modify_list(values=[], pattern="", replacement="", ignorecase=False):
    """ Perform a `re.sub` on every item in the list"""
    if ignorecase:
        flags = re.I
    else:
        flags = 0
    _re = re.compile(pattern, flags=flags)
    return [_re.sub(replacement, value) for value in values]