#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)\b(AB)\D*(\d+)\S*?(\d\d)\b(?=[',]|-[A-Z]|$)(?!-[A-Z]+-[A-Z]+-[A-Z])"
Local $sString = "A='AB.224-QW-2018'" & @CRLF & _
"B='AB.876-5-LS-2018'" & @CRLF & _
"C='AB.26-LS-18'" & @CRLF & _
"D='AB-123-6-LS-2017'" & @CRLF & _
"IA-Mb-22L-AB.224-QW-2018-IA-Mb-22L' F='ZX-ss-12L-AB-123-6-LS-2017-BC-22" & @CRLF & _
"A='AB.224-QW-2018'" & @CRLF & _
"B='AB.876-5-LS-2018'" & @CRLF & _
"C='AB.26-LS-18'" & @CRLF & _
"D='AB-123-6-LS-2017'" & @CRLF & _
"E='IA-Mb-22L-AB.224-QW-2018-IA-Mb-22L'" & @CRLF & _
"F='ZX-ss-12L-AB-123-6-LS-2017-BC-22'" & @CRLF & _
"G='AB.224-2018'" & @CRLF & _
"H='AB.224/QW/2018'" & @CRLF & _
"I='AB/224/2018'" & @CRLF & _
"-AB-231-2-33-12-2017,AB-231-1-HD-2017,AB-231-2017" & @CRLF & _
"" & @CRLF & _
"AB-231-2-33-RR-TTLT-ZA-2017"
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