code: def regex_span_tokenize(s, regex):
      
      left = 0
      for m in re.finditer(regex, s, re.U):
          right, next = m.span()
          if right != 0:
              yield left, right
          left = next
      yield left, len(s)
docs: Return spans that identify tokens in s split using regex.