sre bug with \b in locale mode
Oleg Broytmann
phd at phd.pp.ru
Thu Mar 1 12:41:41 EST 2001
Hi!
The following program works fine under python 1.5.2 and has a problem
under python 2.0. It seems like a bug in sre in hadling \b in locale mode.
Is it a known bug? Can anyone test it with latest python/sre (adapt last
line to your locale, please)?
import re, locale
locale.setlocale(locale.LC_ALL, "")
def test(s):
pattern = re.compile(r"\b%s\b" % s, re.LOCALE)
match = pattern.search(s)
if match:
print s, "- found!"
else:
print s, "- not found..."
test("home") # english text
test("вес") # russian cyrillic, encoding koi8-r, locale is koi8-r
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