code: def sub(table, field, pattern, repl, count=0, flags=0):
      
  
      prog = re.compile(pattern, flags)
      conv = lambda v: prog.sub(repl, v, count=count)
      return convert(table, field, conv)
docs: Convenience function to convert values under the given field using a
      regular expression substitution. See also :func:`re.sub`.