Regular expressions and non-standard character set
Oleg Broytmann
phd at phd.pp.ru
Tue Mar 27 10:20:13 EST 2001
On 27 Mar 2001, Petri Mikael Kuittinen wrote:
> I tried to find information about setting locale. The Linux man pages
> nor the standard Python were not helpful on this matter.
Just look into docs for python module locale.
> > >>> import re
> > >>> re.findall(r"\b...\b", "spam, egg, bacon, and ЕДЖ")
> > ['egg', 'and']
> > >>> re.findall(r"(?L)\b...\b", "spam, egg, bacon, and ЕДЖ")
> > ['egg', 'and', 'ЕДЖ']
>
> I tried the above. It didn't work under Python 2.0 under Windows 2000,
This is known bug. Will be fixed in Python 2.1 and, I hope, in Python
2.0.1.
Oleg.
----
Oleg Broytmann http://phd.pp.ru/ phd at phd.pp.ru
Programmers don't die, they just GOSUB without RETURN.
More information about the Python-list
mailing list