#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})(Z|[\+-]\d{2}:?\d{2})?$"
Local $sString = "Should match ISO 8601 datetime for Forecast.io API:" & @CRLF & _
"[YYYY]-[MM]-[DD]T[HH]:[MM]:[SS]" & @CRLF & _
"with an optional time zone formatted as Z for GMT time or {+,-}[HH][MM] (with or without separating colon) for an offset" & @CRLF & _
"" & @CRLF & _
"Should Match:" & @CRLF & _
"2008-09-15T15:53:00" & @CRLF & _
"2007-03-01T13:00:00Z" & @CRLF & _
"2015-10-05T21:46:54-0800" & @CRLF & _
"2015-10-05T21:46:54+00:00" & @CRLF & _
"" & @CRLF & _
"Should Not Match:" & @CRLF & _
"2008" & @CRLF & _
"2008-09" & @CRLF & _
"2008-09-15" & @CRLF & _
"2008-09-15 11:12:13" & @CRLF & _
"2008-09-15 11:12" & @CRLF & _
"1988-05-26T23:00:00.000Z"
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