标签:xxx 2-2 python pat group print import arch int
import re
print re.search(r‘\d{4}-\d{2}-\d{2}‘, ‘xxxx1990-12-20xxxx‘).group(0)
print re.search(r‘\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}‘, ‘xxxx2005-06-04T18:37:11xxxx‘).group(0)
print re.search(r‘\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}‘, ‘xxxx2005-06-04T18:37:11.111xxxx‘).group(0)
pattern=re.compile(r‘(\d{4}-\d{2}-\d{2})((T\d{2}:\d{2}:\d{2}|))((.\d{3})|)‘)
print pattern.search(‘xxxx2005-06-04T18:37:11.111xxxx‘).group(0)
标签:xxx 2-2 python pat group print import arch int
原文地址:https://www.cnblogs.com/pzblog/p/9087591.html