def regex_replace(value='', find='', replace='', ignorecase=False):
    'Replace using regex.'
    if (not isinstance(value, str)):
        value = str(value)
    flags = (re.I if ignorecase else 0)
    regex = re.compile(find, flags)
    return regex.sub(replace, value)
Replace using regex.
def regex_replace(value=, find=, replace=, ignorecase=False):
    
    if (not isinstance(value, str)):
        value = str(value)
    flags = (re.I if ignorecase else 0)
    regex = re.compile(find, flags)
    return regex.sub(replace, value)