#encoding: utf-8
import re
#1.*:可以匹配0或者任意多个字符
text = '0731'
ret = re.match('d*',text)
print(ret.group())
#2.+: 匹配一个或者多个字符
text = '0731'
ret = re.match('d+',text)
print(ret.group())
#3.?:匹配一个或者0个
text = '0731'
ret = re.match('d?',text)
print(ret.group())
#4.{m}:匹配m个字符
text = '0731'
ret = re.match('d{2}',text)
print(ret.group())
#5.{m,n}:匹配m-n个字符
text = '0731'
ret = re.match('d{2,4}',text)
print(ret.group())