#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "((\d+) )(.+)"
Local $sString = "30304 Homer Simpson1" & @CRLF & _
"30305 Homer Simpson2" & @CRLF & _
"30306 Homer Simpson3" & @CRLF & _
"30307 Homer J Simpson4" & @CRLF & _
"30308 Homer Simpson5" & @CRLF & _
"30309 Homer Simpson6" & @CRLF & _
"30310 Homer Pete Simpson7" & @CRLF & _
"30311 Homer Simpson8" & @CRLF & _
"30312 Homer Simpson9" & @CRLF & _
"30313 Homer Simpson10" & @CRLF & _
"30314 Homer Simpson11" & @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