Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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