#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(\S+(?: \S+)*): *(\S+(?: \S+)*)"
Local $sString = "OK" & @CRLF & _
"AT!GSTATUS?" & @CRLF & _
"!GSTATUS:" & @CRLF & _
"Current Time: 2420 Temperature: 30" & @CRLF & _
"Reset Counter: 1 Mode: ONLINE" & @CRLF & _
"System mode: LTE PS state: Attached" & @CRLF & _
"LTE band: B30 LTE bw: 10 MHz" & @CRLF & _
"LTE Rx chan: 1234 LTE Tx chan: 12345" & @CRLF & _
"LTE CA state: NOT ASSIGNED" & @CRLF & _
"EMM state: Registered Normal Service" & @CRLF & _
"RRC state: RRC Idle" & @CRLF & _
"IMS reg state: No Srv" & @CRLF & _
"" & @CRLF & _
"PCC RxM RSSI: -74 RSRP (dBm): -103" & @CRLF & _
"PCC RxD RSSI: -74 RSRP (dBm): -104" & @CRLF & _
"Tx Power: 0 TAC: 123A (1234)" & @CRLF & _
"RSRQ (dB): -12.4 Cell ID: 1234AB56 (12345678)" & @CRLF & _
"SINR (dB): 9.4"
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