#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?mu)public\s+(.+):([^,]+),?"
Local $sString = "" & @CRLF & _
" public typeface:Typeface," & @CRLF & _
" public weight:FontWeight," & @CRLF & _
" public color:Color," & @CRLF & _
" public size:Units," & @CRLF & _
" public line:Units," & @CRLF & _
" public character:Units," & @CRLF & _
" public fontStyle:ABoolean," & @CRLF & _
" public decorationUnderline:ABoolean," & @CRLF & _
" public decorationCrossed:ABoolean," & @CRLF & _
" "
Local $sSubst = "@prop\n\t\tpublic $1:$2;\n"
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