#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)^[M|m]etalocalypse\ [s|S](\d\d)[e|E](\d\d)"
Local $sString = "Metalocalypse s03e01.avi" & @CRLF & _
"Metalocalypse s03e01.srt" & @CRLF & _
"Metalocalypse s03e02.avi" & @CRLF & _
"Metalocalypse s03e02.srt" & @CRLF & _
"Metalocalypse s03e03.avi" & @CRLF & _
"Metalocalypse s03e03.srt" & @CRLF & _
"Metalocalypse S03E04.avi" & @CRLF & _
"Metalocalypse s03e04.srt" & @CRLF & _
"Metalocalypse s03e05.avi" & @CRLF & _
"Metalocalypse s03e05.srt" & @CRLF & _
"Metalocalypse s03e06.avi" & @CRLF & _
"Metalocalypse s03e06.srt" & @CRLF & _
"Metalocalypse s03e07.avi" & @CRLF & _
"Metalocalypse s03e07.srt" & @CRLF & _
"Metalocalypse s03e08.avi" & @CRLF & _
"Metalocalypse s03e09.avi" & @CRLF & _
"Metalocalypse s03e09.srt" & @CRLF & _
"metalocalypse s03e10.avi" & @CRLF & _
"Metalocalypse s03e10.srt"
Local $sSubst = "Metalocalypse.S\1E\2.XviD"
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