Skip to content

Instantly share code, notes, and snippets.

@k0001
Created December 2, 2010 23:56
Show Gist options
  • Save k0001/726341 to your computer and use it in GitHub Desktop.
Save k0001/726341 to your computer and use it in GitHub Desktop.
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