const regex = new RegExp('(\\w+\\s+)(\\w+\\?*\\s+)(\\w+)\\s+(\\{.+\\})', 'gmi')
const str = `public Guid DellUploadItemID { get; set; }
public Guid UploadID { get; set; }
public string DellPurchaseID { get; set; }
public string PoNum { get; set; }
public string OrderNum { get; set; }
public string OrderType { get; set; }
public string InvoiceNum { get; set; }
public string PaymentDescription { get; set; }
public DateTime? OrderDate { get; set; }
public DateTime? ShippedDate { get; set; }
public DateTime? InvoiceDate { get; set; }
public decimal ReportLineTotal { get; set; }
public string ServiceTag { get; set; }
public string Category { get; set; }
public string SubCategory { get; set; }
public string Item { get; set; }
public string ItemLongName { get; set; }
public DateTime? WarrantyEndDate { get; set; }
public string ShipFirstName { get; set; }
public string ShipLastName { get; set; }
public string ShipToCompany { get; set; }
public string ShipAddress1 { get; set; }
public string ShipAddress2 { get; set; }
public string ShipCity { get; set; }
public string ShipState { get; set; }
public string ShipZip { get; set; }
public string ShipMethod { get; set; }
public string CarrierName { get; set; }
public string WaybillNumber { get; set; }
public string ExpressServiceCode { get; set; }
public string MACAddress { get; set; }
public string MACAddress2 { get; set; }`;
const subst = `\3 = d.\3,`;
// The substituted value will be contained in the result variable
const result = str.replace(regex, subst);
console.log('Substitution result: ', result);
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 JavaScript, please visit: https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions