python 正则表达式

([0-9x]+)

re.match('正则',字符串),从开头匹配

re.search('正则,字符串'),查找。

如果存在,使用span方法查看位置,返回元组

if re.match('	([0-9]+)	 [',line):
    tuple1 = re.match('	([0-9]+)	 [',line).span()
    
原文地址:https://www.cnblogs.com/61355ing/p/11061921.html