import re
s = '待匹配字符'
regx = '^.*"ts": "(d{4}-d{2}-d{2} d{2}:d{2}:d{2},d{3})",.*"loglv": "(.*)",.*"fname": "(.*)",.*"lineno": (.*),.*$' #正则表达式字符
pattern = re.compile(regx)
result = re.findall(pattern, s)
print(result)
import re
s = '待匹配字符'
regx = '^.*"ts": "(d{4}-d{2}-d{2} d{2}:d{2}:d{2},d{3})",.*"loglv": "(.*)",.*"fname": "(.*)",.*"lineno": (.*),.*$' #正则表达式字符
pattern = re.compile(regx)
result = re.findall(pattern, s)
print(result)