#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?im)^((([0-9]{3}(?![0-9]))|([a-z]{3}(?![a-z])))|(([0-9]{1,2})|([a-z]{1,2}))|-){6,}"
Local $sString = "1234as" & @CRLF & _
"12as32" & @CRLF & _
"09ppdj" & @CRLF & _
"ppdj09" & @CRLF & _
"12asd3" & @CRLF & _
"er123a" & @CRLF & _
"123ab2" & @CRLF & _
"2dgs23" & @CRLF & _
"123as2" & @CRLF & _
"asd12a" & @CRLF & _
"p23bgf" & @CRLF & _
"asdfdw" & @CRLF & _
"123432" & @CRLF & _
"123asd" & @CRLF & _
"ds321a" & @CRLF & _
"12asd1" & @CRLF & _
"1234aa" & @CRLF & _
"a321as" & @CRLF & _
"3asr33" & @CRLF & _
"V-127-DR 27-09-2017 t/m 26-10-2017 MEER INFO WWW.BELASTINGDIENST.NL" & @CRLF & _
"" & @CRLF & _
"XX-99-99- asda sda" & @CRLF & _
"99-99-XX boekeing asdasdasd" & @CRLF & _
"99-XX-99 achrijving" & @CRLF & _
"XX-99-XX " & @CRLF & _
"deze matcht niet XX-XX-99 want het begint niet met een kenteken" & @CRLF & _
"99-XX-XX " & @CRLF & _
"99-XXX-9" & @CRLF & _
"9-XXX-99 dit is een omgschrijving van de belastingdienst" & @CRLF & _
"XX-999-X " & @CRLF & _
"X-999-XX " & @CRLF & _
"XXX-99-X"
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