#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(Order[0-9])(?!.*\1)"
Local $sString = "<ctx>" & @CRLF & _
" <PostCode>XXXXXX</PostCode>" & @CRLF & _
" <Title1>Mr</Title1>" & @CRLF & _
" <Name>John</Name>" & @CRLF & _
" <Order1>£100.00</Order1>" & @CRLF & _
" <Order2>£100.01</Order2>" & @CRLF & _
" <Order3>£100.01</Order3>" & @CRLF & _
" <Order4>£100.01</Order4>" & @CRLF & _
" <Order5>£100.01</Order5>" & @CRLF & _
" <Order6>£100.01</Order6>" & @CRLF & _
" <Order7>£100.01</Order7>" & @CRLF & _
" <Order8>£100.01</Order8>" & @CRLF & _
" <Order9>£100.01</Order9>" & @CRLF & _
" <Order10>£100.01</Order10>" & @CRLF & _
" <Order11>£100.01</Order11>" & @CRLF & _
" <Order50>£100.01</Order50>" & @CRLF & _
" <Date>10/10/2010</Date>" & @CRLF & _
"</ctx>"
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