#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)^\s*\K\w+"
Local $sString = "{" & @CRLF & _
" questions: [" & @CRLF & _
" {" & @CRLF & _
" name: "name"," & @CRLF & _
" type: "text"," & @CRLF & _
" title: "Please enter your name:"," & @CRLF & _
" placeHolder: "Jon Snow"," & @CRLF & _
" isRequired: true" & @CRLF & _
" }, {" & @CRLF & _
" name: "birthdate"," & @CRLF & _
" type: "text"," & @CRLF & _
" inputType: "date"," & @CRLF & _
" title: "Your birthdate:"," & @CRLF & _
" isRequired: true" & @CRLF & _
" }, {" & @CRLF & _
" name: "color"," & @CRLF & _
" type: "text"," & @CRLF & _
" inputType: "color"," & @CRLF & _
" title: "Your favorite color:"" & @CRLF & _
" }, {" & @CRLF & _
" name: "email"," & @CRLF & _
" type: "text"," & @CRLF & _
" inputType: "email"," & @CRLF & _
" title: "Your e-mail:"," & @CRLF & _
" placeHolder: "jon.snow@nightwatch.org"," & @CRLF & _
" isRequired: true," & @CRLF & _
" validators: [" & @CRLF & _
" {" & @CRLF & _
" type: "email"" & @CRLF & _
" }" & @CRLF & _
" ]" & @CRLF & _
" }" & @CRLF & _
" ]" & @CRLF & _
"}"
Local $sSubst = ""\0""
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