Код: Выделить всё
text = "bowl"
print(re.search(r"b|bowl", text)) # first alteration in this pattern works
print(re.search(r"o|bowl", text)) # but first alteration won't work here
print(re.search(r"w|bowl", text)) # nor here
print(re.search(r"l|bowl", text)) # nor here
print(re.search(r"bo|bowl", text)) # first alteration in this pattern works
print(re.search(r"bow|bowl", text)) # first alteration in this pattern works
Код: Выделить всё
Подробнее здесь: https://stackoverflow.com/questions/774 ... -in-python
Мобильная версия