#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?x) (?<!\d) (\d{5} | K\d{4}) (?!\d)"
Local $sString = "(1) | 1 | 2018/ID11298 00000012345 PersoNR: 889899 Bridgestone BNPN" & @CRLF & _
"(2) | 3 | Kompo 32280EP ###Baukasten### 3789936690 ID PFK Carbon0" & @CRLF & _
"(3) | 2 | 20613, 20614, Mietop Antragsnummer C300Coup IVS 33221 ABF" & @CRLF & _
"(4) | 2 | Q21009 China lokal produzierte Derivate f/Radverbund 991222 VV" & @CRLF & _
"(5) | 6 | ID:61953 F-Pace Enfantillages (Machine arriere) VvSKPMG Lyon09" & @CRLF & _
"(6) | 2 | 2017/22222 22222 21895 Einzelkostenprob. 28932 ZürichMP KOS" & @CRLF & _
"(7) | K | ID:K1245 Panamera Nitsche Radlager Derivativ Bayreumion PwC" & @CRLF & _
"(8) | 7 | LaunchSupport QBremsen BBG BFG BBD 70142,70119 KK 70142"
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