Python and Cyrillic characters in regular expression
xpahos at gmail.com
Fri Sep 5 13:28:14 CEST 2008
string = u"Привет"
string = u"Hi.Привет"
On Sep 4, 9:53 pm, Fredrik Lundh <fred... at pythonware.com> wrote:
> phasma wrote:
> > Hi, I'm trying extract all alphabetic characters from string.
> > reg = re.compile('(?u)([\w\s]+)', re.UNICODE)
> > buf = re.match(string)
> > But it's doesn't work. If string starts from Cyrillic character, all
> > works fine. But if string starts from Latin character, match returns
> > only Latin characters.
> can you provide a few sample strings that show this behaviour?
More information about the Python-list