fork download
  1. # -*- coding: utf-8 -*-
  2. import re
  3. p = re.compile(ur'\b[^\Wa]+\b', re.UNICODE)
  4. s = u"asfdba12312sssdr1 12şljş1 kf"
  5. res = [x.encode('utf8') for x in p.findall(s)]
  6. print(res)
  7.  
Success #stdin #stdout 0.01s 8968KB
stdin
Standard input is empty
stdout
['12\xc5\x9flj\xc5\x9f1', 'kf']