code: def extend_regex2(regexpr, reflags=0):
      
      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
docs: also preprocesses flags