写个正则表达式来匹配import re
value = '"EA" & vbCrLf & "DATE 22/08/12" & vbCrLf & "TIME 11:45:57.300 " & vbCrLf & "E 0301 ??C +99999999E-01" & vbCrLf & "E 0302 ??C +99999999E-01" & vbCrLf & "E 0303 ??C +99999999E-01" & vbCrLf & "E 0304 ??C +99999999E-01" & vbCrLf & "E 0305 ??C +99999999E-01" & vbCrLf & "E 0306 ??C +99999999E-01" & vbCrLf & "E 0307 ??C +99999999E-01" & vbCrLf & "E 0308 ??C +99999999E-01" & vbCrLf & "E 0309 ??C +99999999E-01" & vbCrLf & "E 0310 ??C +99999999E-01" & vbCrLf & "O 0401 ??C -99999999E-01" & vbCrLf & "N 0402 V +00000000E-04" & vbCrLf & "N 0403 V +00000000E-04" & vbCrLf & "N 0404 V +00000001E-04" & vbCrLf & "N 0405 V +00000001E-04" & vbCrLf & "N 0406 V +00000001E-04" & vbCrLf & "N 0407 V +00000001E-04" & vbCrLf & "N 0408 V +00000001E-04" & vbCrLf & "N 0409 V +00000001E-04" & vbCrLf & "N 0410 V +00000001E-04" & vbCrLf & "N 0501 ??C -00000611E-01" & vbCrLf & "N 0502 V +00000000E-04" & vbCrLf & "N 0503 V +00000000E-04" & vbCrLf & "N 0504 V +00000000E-04" & vbCrLf & "N 0505 V +00000000E-04" & vbCrLf & "N 0506 V +00000000E-04" & vbCrLf & "N 0507 V +00000001E-04" & vbCrLf & "N 0508 V +00000001E-04" & vbCrLf & "EN" & vbCrLf'
valueList = re.findall("[+-][0-9]+E-[0-9]+",value)
print(valueList)
|