#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)class MyNewLanguage extends PureComponent {" & @CRLF & _
"" & @CRLF & _
" //" & @CRLF & _
" // Proptypes" & @CRLF & _
"" & @CRLF & _
" static propTypes = {" & @CRLF & _
" regex: PropTypes.string.isRequired," & @CRLF & _
" flags: PropTypes.string.isRequired," & @CRLF & _
" delimiter: PropTypes.string.isRequired," & @CRLF & _
" testString: PropTypes.string.isRequired," & @CRLF & _
" isSubstituting: PropTypes.bool.isRequired," & @CRLF & _
" isGlobal: PropTypes.bool.isRequired," & @CRLF & _
" substString: PropTypes.string" & @CRLF & _
" };" & @CRLF & _
"" & @CRLF & _
" //" & @CRLF & _
" // Control" & @CRLF & _
"" & @CRLF & _
" // If you need to manipulate any data, you should preferably do it in a function defined " & @CRLF & _
" // on the class body here. This could for example be sanitizing data (escaping quotes, etc)." & @CRLF & _
"" & @CRLF & _
" //" & @CRLF & _
" // Render functions" & @CRLF & _
"" & @CRLF & _
" render() {" & @CRLF & _
" return (" & @CRLF & _
" <Highlight lang="myNewLanguage">" & @CRLF & _
" {this._renderCode()}" & @CRLF & _
" </Highlight>" & @CRLF & _
" );" & @CRLF & _
" }" & @CRLF & _
"" & @CRLF & _
" _renderCode() {" & @CRLF & _
" const { regex, flags, delimiter, testString, isSubstituting, substString, isGlobal } = this.props;" & @CRLF & _
"" & @CRLF & _
" const codeString = new CodeString();" & @CRLF & _
" " & @CRLF & _
" // CodeString is a basic class that allows you to create a code snippet without having" & @CRLF & _
" // to worry about indentation or newlines." & @CRLF & _
"" & @CRLF & _
" // The only functions are `append`, `indent` and `toString`." & @CRLF & _
" // The implementation can be found on this page." & @CRLF & _
"" & @CRLF & _
" // Create your code string here" & @CRLF & _
" codeString.append(`Use string literals when ${regex} interpolating ${flags} data`);" & @CRLF & _
" " & @CRLF & _
" return codeString.toString();" & @CRLF & _
" }" & @CRLF & _
"" & @CRLF & _
"}" & @CRLF & _
"" & @CRLF & _
"export default MyNewLangauge;"
Local $sString = "https://google.com`<Field className="flex flex-col p-1">" & @CRLF & _
" <Label>" & @CRLF & _
" I agree to the{' '}" & @CRLF & _
" <a href="https://google.com" target="_blank" className="underline">" & @CRLF & _
" terms and conditions" & @CRLF & _
" </a>" & @CRLF & _
" </Label>" & @CRLF & _
" <Input type="checkbox" />" & @CRLF & _
"</Field>`gm"
Local $sSubst = "/You have bound GoPlus Security Sentinel. Bound address: 0x8baa0e5a9f879ef40d55b7da808d94aca314742c/gm"
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