#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)(?<=(\/\/\[JsonProperty\(Required = Required\.Always\)]\n)|(\/\/\[JsonProperty\(DefaultValueHandling = DefaultValueHandling\.Ignore\)]\n))( public [a-zA-Z]+ )"
Local $sString = "namespace Telegram.Bot.Types.Payments" & @CRLF & _
"{" & @CRLF & _
" /// <summary>" & @CRLF & _
" /// This object contains information about an incoming pre-checkout query" & @CRLF & _
" /// </summary>" & @CRLF & _
" //[JsonObject(MemberSerialization.OptIn, NamingStrategyType = typeof(SnakeCaseNamingStrategy))]" & @CRLF & _
" public sealed record PreCheckoutQuery" & @CRLF & _
" {" & @CRLF & _
" /// <summary>" & @CRLF & _
" /// Unique query identifier" & @CRLF & _
" /// </summary>" & @CRLF & _
" //[JsonProperty(Required = Required.Always)]" & @CRLF & _
" public string Id { get; set; }" & @CRLF & _
"" & @CRLF & _
" /// <summary>" & @CRLF & _
" /// User who sent the query" & @CRLF & _
" /// </summary>" & @CRLF & _
" //[JsonProperty(Required = Required.Always)]" & @CRLF & _
" public User From { get; set; }" & @CRLF & _
"" & @CRLF & _
" /// <summary>" & @CRLF & _
" /// Three-letter ISO 4217 currency code" & @CRLF & _
" /// </summary>" & @CRLF & _
" //[JsonProperty(Required = Required.Always)]" & @CRLF & _
" public string Currency { get; set; }" & @CRLF & _
"" & @CRLF & _
" /// <summary>" & @CRLF & _
" /// Total price in the smallest units of the currency." & @CRLF & _
" /// </summary>" & @CRLF & _
" //[JsonProperty(Required = Required.Always)]" & @CRLF & _
" public int TotalAmount { get; set; }" & @CRLF & _
"" & @CRLF & _
" /// <summary>" & @CRLF & _
" /// Bot specified invoice payload" & @CRLF & _
" /// </summary>" & @CRLF & _
" //[JsonProperty(Required = Required.Always)]" & @CRLF & _
" public string InvoicePayload { get; set; }" & @CRLF & _
"" & @CRLF & _
" /// <summary>" & @CRLF & _
" /// Optional. Identifier of the shipping option chosen by the user" & @CRLF & _
" /// </summary>" & @CRLF & _
" //[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]" & @CRLF & _
" public string ShippingOptionId { get; set; }" & @CRLF & _
"" & @CRLF & _
" /// <summary>" & @CRLF & _
" /// Optional. Order info provided by the user" & @CRLF & _
" /// </summary>" & @CRLF & _
" //[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]" & @CRLF & _
" public OrderInfo OrderInfo { get; set; }" & @CRLF & _
" }" & @CRLF & _
"}" & @CRLF & _
""
Local $sSubst = " [JsonPropertyName("")]\n$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