#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^(?:bool|double|int(?!.*?([0-9a-z])\1))\s+(?:\b[A-Z](?!\w*___)[0-9a-z_]+,?\s*){1,5}\b;$"
Local $sString = " Valid:" & @CRLF & _
"int Xy;" & @CRLF & _
"double A1b, B_2;" & @CRLF & _
"bool Cx, D3_z;" & @CRLF & _
"" & @CRLF & _
"Invalid:" & @CRLF & _
"int X;" & @CRLF & _
"int X___y;" & @CRLF & _
"int XY;" & @CRLF & _
"int X11;" & @CRLF & _
"double 1A;" & @CRLF & _
"int Xy, A1b, B_2, C3_d, D4e, E5f;"
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