#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?im)public [A-Za-z\?]* ([A-Za-z0-9]*) .*"
Local $sString = " " & @CRLF & _
" public string AddressLine1 { get; set; }" & @CRLF & _
"" & @CRLF & _
" public string AddressLine2 { get; set; }" & @CRLF & _
"" & @CRLF & _
" public string AddressLine3 { get; set; }" & @CRLF & _
"" & @CRLF & _
" public string AddressLine4 { get; set; }" & @CRLF & _
"" & @CRLF & _
" public string AddressLine5 { get; set; }" & @CRLF & _
"" & @CRLF & _
" public string AddressLine6 { get; set; }" & @CRLF & _
"" & @CRLF & _
" public DateTime? Dob { get; set; }" & @CRLF & _
"" & @CRLF & _
" public string EmailAddress { get; set; }" & @CRLF & _
"" & @CRLF & _
" public string FirstName { get; set; }" & @CRLF & _
"" & @CRLF & _
" public string LastName { get; set; }" & @CRLF & _
"" & @CRLF & _
" public string PostCode { get; set; }" & @CRLF & _
"" & @CRLF & _
" public string PrimaryPhoneNo { get; set; }" & @CRLF & _
"" & @CRLF & _
" public string Title { get; set; }"
Local $sSubst = "$1 = customerDetails.$1,"
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