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