I need to parse multiple email bodies that look like using google apps script:
Name: Bob smith
Email: hellol@aol.com
Phone Number: 4243331212
I want to split on the heading at the beginning of each line .I have the following function:
function parseBody (i, body) {
var split = body.split(new RegExp(/(\w*): ([^\t\r\n]*)[\t\r\n]*/)) //removes trailing line feed
.filter(function (x) { return x })
.....
}
but the regex is not working, only capturing the first title when I test on http://www.regexpal.com/ . What am I doing wrong?
edit: