#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)(?<=/[*]{2}|(?<!\A)\G)\n\K^\s*+(?![*]/)(.*)$"
Local $sString = "/**" & @CRLF & _
" Lorem Ipsum is simply dummy text of the printing and typesetting industry. " & @CRLF & _
" Lorem Ipsum has been the industry's standard dummy text ever since the " & @CRLF & _
" 1500s, when an unknown printer took a galley of type and scrambled it to " & @CRLF & _
" make a type specimen book. It has survived not only five centuries, but " & @CRLF & _
" also the leap into electronic typesetting, remaining essentially " & @CRLF & _
" unchanged. It was popularised in the 1960s with the release of Letraset " & @CRLF & _
" sheets containing Lorem Ipsum passages, and more recently with desktop " & @CRLF & _
" publishing software like Aldus PageMaker including versions of Lorem Ipsum." & @CRLF & _
" */" & @CRLF & _
"" & @CRLF & _
"[rest of code]"
Local $sSubst = "/// $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