Created
December 2, 2010 23:56
-
-
Save k0001/726341 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [313]: rx = r'(.*?), *(.*?[%(uni_az)s])([%(uni_AZ)s].*?[%(uni_az)s](?=[%(uni_AZ)s]))(.*)' % { | |
.....: 'uni_AZ': u"A-ZÑÀÁÄÂÉÈËÊÍÌÏÎÓÒÖÔÚÙÜÛ", | |
.....: 'uni_az': u"a-zñàáäâéèëêíìïîóòöôúùüû" } | |
In [314]: w = u'FOO, Bar BaSomewhere ÖverÉloh Rainbow' | |
In [315]: re.match(rx, w).groups() | |
Out[315]: (u'FOO', u'Bar Ba', u'Somewhere \xd6ver', u'\xc9loh Rainbow') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment