#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)Invoice ((?:[0-9]){8})"
Local $sString = "THIS IS AN EXAMPLES OF Invoice Email Subject sample" & @CRLF & _
"Harmonie Mutuelle - Invoice 1234567890123456" & @CRLF & _
"123 WDD2052041F133125 - CORRECT VIN" & @CRLF & _
"44 WDD 169 007-1J-236589 - ALSO CORRECT VIN" & @CRLF & _
"1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 - INCORRECT VIN" & @CRLF & _
"AND THIS IS JUST CAPS TEXT FOR THE TEST" & @CRLF & _
"WDD2052041F133125" & @CRLF & _
"WDD 2052041F133125 - VIN WITH TAB" & @CRLF & _
"!! WDD2052041F133125" & @CRLF & _
"- TWO VINS CODES ONE BY ONE" & @CRLF & _
"W D - - - D 2 0 5 2---0 4 1 F-1 3-3125 " & @CRLF & _
"- MULTIPLE DELIMITERS" & @CRLF & _
"X WDD" & @CRLF & _
"2052041F133125" & @CRLF & _
"- MULTILINE DELIMITERS" & @CRLF & _
"(WDD2052041F133125)"
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