Skip to content

Instantly share code, notes, and snippets.

@leafnode
Created October 6, 2010 07:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leafnode/612960 to your computer and use it in GitHub Desktop.
Save leafnode/612960 to your computer and use it in GitHub Desktop.
import re
a = u'Brzozowa 4/5'
re.split('\W+',a, re.UNICODE)
# [u'Brzozowa', u'4', u'5']
a = u'Drzymały 4/5'
re.split('\W+',a, re.UNICODE)
# chce: [u'Drzymały', u'4', u'5']
# dostaję: [u'Drzyma', u'y', u'4', u'5']
# W innych regexpach to działa
re.findall('\w', 'zażółć')
# ['z', 'a']
re.findall('\w', 'zażółć', re.UNICODE)
# ['z', 'a', '\xc5', '\xbc', '\xc3', '\xb3', '\xc5', '\xc4']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment