python版本为3.6.6
源码
>>> patt = '-?\d+'
>>> m = re.match(patt, '--12415415')
>>> if m is not None:m.group()
>>> m = re.match(patt, '-12415415')
>>> if m is not None:m.group()
'-12415415'
>>> m = re.match(patt, '12415415')
>>> if m is not None:m.group()
'12415415'
成功!,正则意思为:’-‘出现零或者一次,后面接出现一次以上的整数~。