#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(?=^[A-Za-z\d -\/:-@[-`{-~À-ÿ]{8,30}$)^(?:[A-Za-z\d]*[ -\/:-@[-`{-~À-ÿ]){0,3}[A-Za-z\d]*$"
Local $sString = "AABBCCDD" & @CRLF & _
"OK -- Match" & @CRLF & _
"" & @CRLF & _
"aabbccdd" & @CRLF & _
"OK -- Match" & @CRLF & _
"" & @CRLF & _
"11111111" & @CRLF & _
"OK -- Match" & @CRLF & _
"" & @CRLF & _
"A1A1b2b2" & @CRLF & _
"OK -- Match" & @CRLF & _
"" & @CRLF & _
"A@~D1dIo" & @CRLF & _
"OK -- Match" & @CRLF & _
"" & @CRLF & _
"AAB BCC0" & @CRLF & _
"OK -- Match (1 special, it's okay)" & @CRLF & _
"" & @CRLF & _
"AABBCC@@" & @CRLF & _
"OK -- Match (2 specials, it's okay)" & @CRLF & _
"" & @CRLF & _
"AABB C " & @CRLF & _
"OK -- Match (3 specials, it's okay)" & @CRLF & _
"" & @CRLF & _
"A@~` C:" & @CRLF & _
"OK -- Match (3 specials, it's okay)" & @CRLF & _
"" & @CRLF & _
"AABB" & @CRLF & _
"OK -- Should't match and didn't match (Less than 8 symbols)" & @CRLF & _
"" & @CRLF & _
"AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPP" & @CRLF & _
"OK -- Should't match and didn't match (More than 30 symbols)" & @CRLF & _
"" & @CRLF & _
"AA@@@@BB" & @CRLF & _
"ERROR ! -- Shouldn't match (4 specials, it's forbidden)" & @CRLF & _
"" & @CRLF & _
"AAB B" & @CRLF & _
"ERROR ! -- Shouldn't match (4 specials, it's forbidden)" & @CRLF & _
"" & @CRLF & _
"AABB@@@@" & @CRLF & _
"ERROR ! -- Shouldn't match (4 specials, it's forbidden)" & @CRLF & _
"" & @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