Найти - Пользователи
Полная версия: Регистронезависимый поиск и re.search
Начало » Python для новичков » Регистронезависимый поиск и re.search
1
Why
Здравствуйте!

>>> pattern = u'Болото'
>>> text = u'Болото'

>>> match = re.search(pattern, text)

>>> print match
<_sre.SRE_Match object at 0x011DD368>

>>> pattern = u'болото'

>>> match = re.search(pattern, text, re.IGNORECASE)

>>> print match
None
ЧЯДНТ?

Python 2.7
PooH
re.IGNORECASE | re.UNICODE
Why
Спасибо! Теперь работает.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB