code: def tokenise(cls, route):
          ''' Split a string into an iterator of (type, value) tokens. '''
          match = None
          for match in cls.syntax.finditer(route):
              pre, name, rex = match.groups()
              if pre: yield ('TXT', pre.replace('\\:',':'))
              if rex and name: yield ('VAR', (rex, name))
              elif name: yield ('VAR', (cls.default, name))
              elif rex: yield ('ANON', rex)
          if not match:
              yield ('TXT', route.replace('\\:',':'))
          elif match.end() < len(route):
              yield ('TXT', route[match.end():].replace('\\:',':')f tokenise(cls, route):
          ''' Split a string into an iterator of (type, value) tokens. '''
          match = None
          for match in cls.syntax.finditer(route):
              pre, name, rex = match.groups()
              if pre: yield ('TXT', pre.replace('\\:',':'))
              if rex and name: yield ('VAR', (rex, name))
              elif name: yield ('VAR', (cls.default, name))
              elif rex: yield ('ANON', rex)
          if not match:
              yield ('TXT', route.replace('\\:',':'))
          elif match.end() < len(route):
              yield ('TXT', route[match.end():].replace('\\:',':'))
docs: Split a string into an iterator of (type, value) tokens.