#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?mi)((AD)|(AG)|(EX))[0-9]{8}"
Local $sString = "EX09551115 " & @CRLF & _
"AD09551115 " & @CRLF & _
"AG09551115 " & @CRLF & _
"" & @CRLF & _
"EA09551115 " & @CRLF & _
"EG09551115 " & @CRLF & _
"AE09551115 " & @CRLF & _
"AX09551115 " & @CRLF & _
"DG09551115 " & @CRLF & _
"GD09551115 " & @CRLF & _
"XE09551115 " & @CRLF & _
"GA09551115 " & @CRLF & _
"DA09551115 " & @CRLF & _
"XD09551115 " & @CRLF & _
"XG09551115 " & @CRLF & _
"GX09551115 " & @CRLF & _
"DX09551115"
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