#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)SSR.(....)(.BE.)(\w+)(-1)(\w+)(\/)(\w+).*"
Local $sString = "SSR BAGW BE HK1DUBEXT0304H13OCT-1TIMBRELL/TEGAELAMISS.1P/AUTH 23KG" & @CRLF & _
"SSR BAGA BE HK1DUBLON0301H13NOV-1TIMBRELL/TEGAELAMISS.1P/AUTH 23KG" & @CRLF & _
"SSR DOCS BE HK1DUBEXT0204H13DEC-1TIMBRELL/TEGAELAMISS" & @CRLF & _
"SSR PETC BE HK1LONEXT0334H13JAN-1TIMBRELL/TEGAELAMISS" & @CRLF & _
"SSR WCHR BE HK1DUBEXT0204H13DEC-1TIMBRELL/TEGAELAMISS" & @CRLF & _
"SSR BAGW BE HK1DUBLON0301H13NOV-1TIMBRELL/TEGAELAMISS.1P/AUTH 23KG" & @CRLF & _
"BE7351 H 08NOV18MANMXP HK4/11251440" & @CRLF & _
"BE2108R/VS8508Y 11NOV18LHREDI HK10/18202000" & @CRLF & _
"A97351 H 08NOV18MANMXP HK4/11251440"
Local $sSubst = "\1-\5-\7"
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