def extend_regex2(regexpr, reflags=0):
    """
    also preprocesses flags
    """
    regexpr = extend_regex(regexpr)
    IGNORE_CASE_PREF = '\\c'
    if regexpr.startswith(IGNORE_CASE_PREF):
        # hack for vim-like ignore case
        regexpr = regexpr[len(IGNORE_CASE_PREF):]
        reflags = reflags | re.IGNORECASE
    return regexpr, reflags
def extend_regex2 ( regexpr , reflags = 0 ) : regexpr = extend_regex ( regexpr ) IGNORE_CASE_PREF = '\\c' if regexpr . startswith ( IGNORE_CASE_PREF ) : regexpr = regexpr [ len ( IGNORE_CASE_PREF ) : ] reflags = reflags | re . IGNORECASE return regexpr , reflags
also preprocesses flags