#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?mi)\s+(<.+>)\s+(@.+)\)\s+(@.+)\)\s+(@.+\))\s+(<.+>)"
Local $sString = " <div class="mr-data-inputfield">" & @CRLF & _
" @Html.LabelFor(m => m.Device.ShortDescription)" & @CRLF & _
" @Html.TextBoxFor(m => m.Device.ShortDescription, new { style = "width: 400px;" })" & @CRLF & _
" @Html.ValidationMessageFor(m => m.Device.ShortDescription)" & @CRLF & _
" </div>" & @CRLF & _
" <div class="mr-data-inputfield">" & @CRLF & _
" @Html.LabelFor(m => m.Device.LongDescription)" & @CRLF & _
" @Html.TextAreaFor(m => m.Device.LongDescription)" & @CRLF & _
" @Html.ValidationMessageFor(m => m.Device.LongDescription)" & @CRLF & _
" </div>"
Local $sSubst = "<div class="form-group">\n\t\2, new { @class = "control-label" })\n\t<div class="input-group">\n\t\t\3, new { @class = "form-control" })\n\t\t\4\n\t</div>\n</div>\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