Python 正则表达式之选择

 

In [4]: import re

In [5]: re.findall(r"\d+","jjj1234mm222")
Out[5]: ['1234', '222']

In [6]: re.findall(r"\d+","jjj1234")
Out[6]: ['1234']

 

In [18]: import re

In [19]: re.match(r"^#","#jjj")
Out[19]: <_sre.SRE_Match at 0x7fd89c9af370>

In [20]: re.match(r"^#","jjj")

posted @ 2017-01-14 16:27  xiaojikuaipao  阅读(516)  评论(0编辑  收藏  举报