const regex = /(?<=Full\sName\r?\n).*$/gm;
// Alternative syntax using RegExp constructor
// const regex = new RegExp('(?<=Full\\sName\\r?\\n).*$', 'gm')
const str = `
Saturday, November 13, 2021 at 03:12:14 India Standard Time
Subject: FW: [External] New Outdoor Adver=sing
Date: Saturday, 13 November 2021 at 3:05:06 AM India Standard Time
From:me
To: ro
Category: MCL:All Employees
Saumil,
Quote: Q-22222
Confirming a TCV of \$6,588.95
*The PO did not upload into the SFDC opportunity.
Thank you,
Cecil
From: Upstream
Date: Friday, November 12, 2021 at 2:30 PM
To: DL
Subject: [External] New Adver=sing
Page 1 of 5New Order
Buyer ID
123
Offer ID Product ID
125489
Product Code
8gvrhm11221
Dimension Pricing
Page 2 of Falcon Premium
Quantity 50
Price Per \$131.78
Total Price \$6588.95
Contract Value
Falcon Premium
Duration 12 Months
Gross Contract \$6588.95
Value
Marketplace Fee 0.00%
Net Contract Value \$6588.95
Contract Metadata
Account Number
1212121
Salesforce Opportunity
nmh
Quote Number
Q-9090
Registration Details
Company
Advertising
Full Name
Omkar Derryberry
Email Address
Page 3 of om@qes.com
Are You An Existing
Yes
AWS Account ID
121212
Phone Number
5412969684
Address
12221 bekery Road
City
The USA
State/Province
Mohan
Zip/Postal Code
202020
Country
In Sky
Entitlements
Quantity 50
Expiration 2022-11-12T20:19:43
Please contact them directly to confirm the purchase and gather any
additional information. It’s time to deploy some software!
Cheers!
Team xyz
Page 5 of 5`;
let m;
while ((m = regex.exec(str)) !== null) {
// This is necessary to avoid infinite loops with zero-width matches
if (m.index === regex.lastIndex) {
regex.lastIndex++;
}
// The result can be accessed through the `m`-variable.
m.forEach((match, groupIndex) => {
console.log(`Found match, group ${groupIndex}: ${match}`);
});
}
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