#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^('[0-9]*',?){3}$"
Local $sString = " Account Source Source2 Source3 Source4 Source5 " & @CRLF & _
"'39','39'" & @CRLF & _
"'41','41'" & @CRLF & _
"'67','67'" & @CRLF & _
"'286','286'" & @CRLF & _
"'','299','2312210299'" & @CRLF & _
"'307','307'" & @CRLF & _
"'341','341'" & @CRLF & _
"'349','349'" & @CRLF & _
"'351','351'" & @CRLF & _
"'359','359'" & @CRLF & _
"'362','362'" & @CRLF & _
"'363','363'" & @CRLF & _
"'378','378'" & @CRLF & _
"'511','511','6218','2197360511'"
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