#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(?xi)^( (DE)?[0-9]{9}|)$"
Local $sString = "ATU99999999" & @CRLF & _
"BE0999999999" & @CRLF & _
"BG999999999" & @CRLF & _
"HR12345678901" & @CRLF & _
"CY99999999L" & @CRLF & _
"CZ12345678" & @CRLF & _
"DK99999999" & @CRLF & _
"EE123456789" & @CRLF & _
"FI99999999" & @CRLF & _
"FRXX999999999" & @CRLF & _
"DE999999999" & @CRLF & _
"EL123456789" & @CRLF & _
"HU12345678" & @CRLF & _
"IE1S23456L" & @CRLF & _
"IE1234567T" & @CRLF & _
"IE1234567TW" & @CRLF & _
"IE1234567FA" & @CRLF & _
"ESA12345678" & @CRLF & _
"ESZ1234567E" & @CRLF & _
"DE813992525"
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