#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?sm)^\/(\*\*-+\*\*)\\$(.*?)^\\\1\/$|."
Local $sString = "/**--------------------------------------------------------------------------**\" & @CRLF & _
"<summary>FunctionName</summary>" & @CRLF & _
"<returns>" & @CRLF & _
" Returns 1 on success." & @CRLF & _
" Returns 0 on failure." & @CRLF & _
"</returns>" & @CRLF & _
"<remarks>" & @CRLF & _
" This function is a function." & @CRLF & _
"</remarks>" & @CRLF & _
"\**--------------------------------------------------------------------------**/" & @CRLF & _
"" & @CRLF & _
"int FunctionName()" & @CRLF & _
"{" & @CRLF & _
" int X = 1;" & @CRLF & _
" if(X == 1)" & @CRLF & _
" return 1;" & @CRLF & _
" return 0;" & @CRLF & _
"}"
Local $sSubst = "$2"
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