#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m-s)^(..).*+(?>\r?\n\1.*){2}\K(?:\r?\n\1.*)+"
Local $sString = "at58" & @CRLF & _
"at59" & @CRLF & _
"at60" & @CRLF & _
"at61" & @CRLF & _
"at62" & @CRLF & _
"au344" & @CRLF & _
"au347" & @CRLF & _
"au348" & @CRLF & _
"au349" & @CRLF & _
"au350" & @CRLF & _
"ba5" & @CRLF & _
"ba6" & @CRLF & _
"ba7" & @CRLF & _
"be72" & @CRLF & _
"be73" & @CRLF & _
"be74" & @CRLF & _
"be75" & @CRLF & _
"be76 "
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