#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)(?i)(?:\[|\()(?:M|F|T|MF|FM|\?)(?:\d+)?(?:M|F|T|MF|FM|\?)?(?:\d+)?(?:\]|\))"
Local $sString = "[F]" & @CRLF & _
"(F)" & @CRLF & _
"[M]" & @CRLF & _
"(M)" & @CRLF & _
"[T]" & @CRLF & _
"(T)" & @CRLF & _
"[FM]" & @CRLF & _
"[MF]" & @CRLF & _
"(FM)" & @CRLF & _
"(MF)" & @CRLF & _
"[F44]" & @CRLF & _
"(f45)" & @CRLF & _
"[F44M50]" & @CRLF & _
"[M21F31]" & @CRLF & _
"(F44M50)" & @CRLF & _
"(M21F31)"
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