#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^\d{4}[A-Za-z]{2}$"
Local $sString = "Valid from" & @CRLF & _
"Zipcode from" & @CRLF & _
"0000AA" & @CRLF & _
"1798AA" & @CRLF & _
"8900AA" & @CRLF & _
"9167aa" & @CRLF & _
"" & @CRLF & _
"Valid from" & @CRLF & _
"Zipcode to" & @CRLF & _
"1797zz" & @CRLF & _
"8899ZZ" & @CRLF & _
"9166ZZ" & @CRLF & _
"9999ZZ"
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