#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)\b[a-zA-Z]{1,2}\d{3,5}[a-zA-Z]?\b"
Local $sString = "M394" & @CRLF & _
",MP4245)" & @CRLF & _
"TD493!" & @CRLF & _
"X4958A" & @CRLF & _
"V49534@" & @CRLF & _
"U394U" & @CRLF & _
"A5909." & @CRLF & _
"" & @CRLF & _
"TED492" & @CRLF & _
"R32" & @CRLF & _
"R4!3" & @CRLF & _
"U394UU" & @CRLF & _
"A5909AA" & @CRLF & _
"5349A"
Local $sSubst = ""
Local $sResult = StringRegExpReplace($sString, $sRegex, $sSubst)
MsgBox($MB_SYSTEMMODAL, "Result", $sResult)
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