#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(\[\d{3,5} ?x ?\d{3,5}\])"
Local $sString = "Should match:" & @CRLF & _
"" & @CRLF & _
"Hey guys check out this awesome hi-def picture! [320x480]" & @CRLF & _
"" & @CRLF & _
"[F]irst time here plz be nice [6969x6969]" & @CRLF & _
"" & @CRLF & _
"Spaces around the x [123 x 456]" & @CRLF & _
"" & @CRLF & _
"herp derp durr (smallest dimensions that will match) [100x100]" & @CRLF & _
"" & @CRLF & _
"Check out this massive 2.1 jiggapixel image of the entire USA in high detail! (highest dimensions that will match) [99999x99999]" & @CRLF & _
"" & @CRLF & _
"Should not match:" & @CRLF & _
"" & @CRLF & _
"Please go to this spammy site and buy shit so we can steal your credit card (no tag)" & @CRLF & _
"" & @CRLF & _
"Letters in the tag [i234x5678]" & @CRLF & _
"" & @CRLF & _
"Dimension too small [99 x 123]" & @CRLF & _
"" & @CRLF & _
"Dimension too big [100000 x 123]" & @CRLF & _
"" & @CRLF & _
""
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