I have being trying to Parse this text properly for a couple days now. I cannot seem to figure out how to collect the text after Traveller name in the following Text:
---------- Forwarded message --------- From: Mai Le Date: Thu, Sep 10, 2015 at 11:32 PM Subject: Inquiry from Mai Le: Sep 26 through 28 - VRBO.com #468160 To: , Congratulations, you have a new inquiry! [image: VRBO from HomeAway] [image: Our Family of Brands] Hello, Mai Le is interested in your property. Property #468160 Dates Available * Sep 26-28, 2015 * , 2 nights Guests 4 adults, 2 children Traveler name Mai Le Traveler email [email protected] Traveler phone + CA 6138842305 Inquiry from HomeAway.com Total rental amount $448.00 including taxes and fees ------------------------------ * Message from Mai Le* Hello, I would like to finalize my booking. Please let me know the best number i can reach you for details. I have 5 adults and 2 small children. Mai ------------------------------ Respond in your dashboard Or, reply to this email Respond quickly to increase your chance of securing the booking. Looking for more inquiries? Listings with a quality score of 80% or greater get 15%* more demand! Follow the customized recommendations in your dashboard now. * Based on internal metrics taken from data on VRBO.com between December 1, 2014 and December 31, 2014 Download the HomeAway app so you can reply to travelers, send payment details, manage your calendar, and more on your mobile device. ------------------------------ [image: Facebook] [image: Twitter] © 2015 HomeAway.com, Inc. All rights reserved. VRBO and the VRBO logos are trademarks of HomeAway.com, Inc. HomeAway.com, Inc. is located at 1011 West Fifth Street, Suite 300, Austin, Texas, 78703. This email was sent to [email protected],[email protected]. View our Privacy Statement | Contact Us | Terms & Conditions
I need to search for Traveler name using Regex to collect "Mai Le", and paste that into the Lead.Name field on a new lead record. I'm not sure why this isn't working but here is my current regex formula.
Pattern p = Pattern.compile('(?m)(?i)^\\s*name(.*)');
Matcher pm = p.matcher( leadRecord.RichEmailText__c );
if( pm.matches() )
{
leadRecord.Email_Guest_Name__c = pm.group(1);
}