def split(self, x, keep_delims = False):
    """Like re.split but skips matches outside of configured range."""
    prev_end = 0
    out = []
    for match in self.finditer(x):
      out.append(x[prev_end:match.start()].strip())
      prev_end = match.start() if keep_delims else match.end()
    out.append(x[prev_end:].strip())
    return out
Like re.split but skips matches outside of configured range.
language/fruit/rendering_utils.py