#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^([sS][gG][1|4]|[aA][lL][6-7|10|2-3]|[wW][dD][23|25|7|4]|[hH][pP][1|3-4]|[lL][uU]1)\d?\b"
Local $sString = "SG1" & @CRLF & _
"SG4" & @CRLF & _
"AL2" & @CRLF & _
"AL6" & @CRLF & _
"AL7" & @CRLF & _
"AL10" & @CRLF & _
"WD4" & @CRLF & _
"WD7" & @CRLF & _
"WD23" & @CRLF & _
"WD25" & @CRLF & _
"HP1" & @CRLF & _
"HP3" & @CRLF & _
"HP4" & @CRLF & _
"LU1"
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