#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)(?<!BM.)(?<=\W)(SetColor|SetAlpha|DrawRect|Delay|Flip|SetScale|SetVirtualResolution|CloseStream|GraphicsWidth|GraphicsHeight|VirtualResolutionWidth|VirtualResolutionHeight)(?=\W)"
Local $sString = "" & @CRLF & _
"SetColor(0, 0, 0);" & @CRLF & _
" Delay(10);" & @CRLF & _
" Flip();" & @CRLF & _
" SetColor(0, 0, 0);" & @CRLF & _
" SetAlpha(- float(n) / Fade1);" & @CRLF & _
" DrawRect(0, 0,tApplication.ScrW(),tApplication.ScrH());" & @CRLF & _
" BM.SetAlpha(1);" & @CRLF & _
""
Local $sSubst = "BM.$1"
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