#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import re
m = re.search('foo','seadfood')
if m is not None:
print m.group()
输出:
D:\Python27\test>re02.PY
foo
D:\Python27\test>
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import re
m = re.search('foo','seadfood')
if m is not None:
print m.group()
输出:
D:\Python27\test>re02.PY
foo
D:\Python27\test>