In import re In pattern re compile zzz In pattern match 111 zzz 222 Ou

1
2
3
4
5
6
7
8
9
In [2]: import re
In [3]: pattern = re.compile(r'.*zzz.*')
In [4]: pattern.match('111 zzz 222')
Out[4]: <_sre.SRE_Match object at 0x83a8b80>
In [5]: pattern.match('zzz')
Out[5]: <_sre.SRE_Match object at 0x83a8608>