#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^(?<year>\d{4})[\-\.\/]?(?<month>0[1-9]|1[02])[\-\.\/]?(?<day>[0-2]\d|3[0-1])[ T]?(?<hour>[0-1]\d|2[0-3])[\:\.]?(?<minute>[0-5]\d)[\:\.]?(?<second>[0-5]\d) ?(?<offset>(?<offset_sign>[\-\+]*)(?<offset_hour>0[0-9]|1[0-2])[\:\.]?(?<offset_minute>[0-5]\d))"
Local $sString = "--- SHOULD MATCH ---" & @CRLF & _
"20181215144545-06:00" & @CRLF & _
"2018-12-15T14:45:45 -06:00" & @CRLF & _
"2018-12-15 14:45:45 -06:00" & @CRLF & _
"2018.12.15T14.45.45 -06:00" & @CRLF & _
"2018.12.15T14.45.45-06.00" & @CRLF & _
"2018/12/15T14:45:45-06:00" & @CRLF & _
"201812151445450000" & @CRLF & _
"103212150000000000" & @CRLF & _
"103212151111111111" & @CRLF & _
"103212152222221222" & @CRLF & _
"--- SHOULD NOT MATCH ---" & @CRLF & _
"2018-13-15T14:45:45 -06:00" & @CRLF & _
"2018-12-60T14:45:45 -06:00" & @CRLF & _
"2018-12-15T24:45:45 -06:00" & @CRLF & _
"2018-12-15T14:60:45 -06:00" & @CRLF & _
"103212152222222222" & @CRLF & _
"103212152222221322"
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