http://gitunderground.i2p/archive/youtube-dl/commit/34484e49f5cd91a830f5459a5b673b7c05a22e24
[^/[ \ ]()@= \ s]+)| # token: optional {ns} , no specials \ s+ # or white space ''' ) def _xpath_tokenizer ( pattern , namespaces = None ) : for token in _xpath_tokenizer_re . findall ( pattern ) : tag = token [ 1 ] if tag and tag [ 0 ] != " { " and " : " in tag : try : if not namespaces : raise KeyError prefix , uri = tag . split ( " : " , 1 ) yield token [ 0 ] , " { %s } %s " % ( namespaces [ prefix ] , uri ) except KeyError : raise SyntaxError ( "...