#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^([0-8]\d{4}|97[0-6]\d{2}|98[06-9]\d{2}|9[0-69]\d{3})$"
Local $sString = "01001" & @CRLF & _
"11010" & @CRLF & _
"23034" & @CRLF & _
"34567" & @CRLF & _
"2343" & @CRLF & _
"45678" & @CRLF & _
"56786" & @CRLF & _
"67896" & @CRLF & _
"7856" & @CRLF & _
"8990" & @CRLF & _
"89999" & @CRLF & _
"999999" & @CRLF & _
"9741" & @CRLF & _
"9751" & @CRLF & _
"9761" & @CRLF & _
"9771" & @CRLF & _
"9781" & @CRLF & _
"9791" & @CRLF & _
"9811" & @CRLF & _
"9821" & @CRLF & _
"9831" & @CRLF & _
"9841" & @CRLF & _
"9851" & @CRLF & _
"9861" & @CRLF & _
"98l1" & @CRLF & _
"1000" & @CRLF & _
"29098" & @CRLF & _
"78999" & @CRLF & _
"98899" & @CRLF & _
"98900"
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