Python 从字符串中取出日期
原文:https://www.jb51.net/article/172982.htm
import re
str1='访客-2020-03-22 235119.xlsx'
m = re.search("(\d{4}-\d{1,2}-\d{1,2})", str1)
print(type(m))
strdate = m.group(1)
print(strdate)
原文:https://www.jb51.net/article/172982.htm
import re
str1='访客-2020-03-22 235119.xlsx'
m = re.search("(\d{4}-\d{1,2}-\d{1,2})", str1)
print(type(m))
strdate = m.group(1)
print(strdate)