I am looking for some assistance with Regex in splitting the Name field in an email and outputting the results into two variables. Example of the email is below.
Email Template example:
“name : Jo-anne Smith
email : Jo-anne.Smith@gmail.com
Phone : 0400 123 456
additional-comments : Hi
I need to request a leave form.
I would like to be able to grab the first name ‘Jo-anne’ as the first name variable and ‘Smith’ as the surname variable.
I think I have the first name figured it out (some feedback would be great) but I am unable to figure out the surname field.
Regex for first name:
(?<=name : ).*(?= )
Any assistance would be greatly appreciated.
I found this video somewhat helpful but I still couldn’t apply it to my scenario https://www.youtube.com/watch?v=aIEjh0YsxWA