#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(?s)json:(?!.*json:.*totalCount.*).*?totalCount.*?(?=\[2)"
Local $sString = "[2018-12-10 06:30:44]JSON回调处理--->>> 同步运动数据 [2018-12-10 06:30:44]同步运动健康数据json:{ "day" : 10, "items" : [ { "activeTime" : 5, "calory" : 0, "distance" : 0, "stepCount" : 0 }," & @CRLF & _
"{ "activeTime" : 0, "calory" : 0, "distance" : 0, "stepCount" : 0 }, { "activeTime" : 0, "calory" : 0, "distance" : 0, "stepCount" : 0 } ], "month" : 12, "startTime" : 0, "timeSpace" : 15, "totalActiveTime" : 81, "totalCalory" : 0, "totalDistance" : 0, "totalCount" : 0, "year" : 2018 } " & @CRLF & _
"[2018-12-10 06:30:44]同步运动健康数据items.sise()=96" & @CRLF & _
"[2018-12-10 06:30:38]..再同步健康数据... " & @CRLF & _
"[2018-12-10 06:30:44]JSON回调处理--->>> 同步运动数据 [2018-12-10 06:30:44]同步运动健康数据json:{ "day" : 10, "items" : [ { "activeTime" : 5, "calory" : 0, "distance" : 0, "stepCount" : 0 }," & @CRLF & _
"{ "activeTime" : 0, "calory" : 0, "distance" : 0, "stepCount" : 0 }, { "activeTime" : 0, "calory" : 0, "distance" : 0, "stepCount" : 0 } ], "month" : 12, "startTime" : 0," & @CRLF & _
""timeSpace" : 15, "totalActiveTime" : 81, "totalCalory" : 0, "totalDistance" : 0, "StepCount" : 0, "year" : 2018 } " & @CRLF & _
"[2018-12-10 06:30:44]同步运动健康数据items.sise()=96 " & @CRLF & _
"[2018-12-10 06:30:38]..再同步健康数据... "
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYGLOBALFULLMATCH)
Local $aFullArray[0]
For $i = 0 To UBound($aArray) -1
_ArrayConcatenate($aFullArray, $aArray[$i])
Next
$aArray = $aFullArray
; Present the entire match result
_ArrayDisplay($aArray, "Result")
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for AutoIt, please visit: https://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm