javascript - Google Script parsing text -
i have google script program working parsing text. i'm having trouble finding right functions or regular expressions job done. should pull name out of email (which should first thing in email).
here's i'm trying parse out far:
derek antrican<br /> <br /> ==================================================================<br /> mobile text message brought at&t<br />
basically want code take current string above, sort out first 1 or 2 full words (anything before html line break tag) , assign resulting string variable "parse".
here's have far code:
//var loc = body.findtext("\a\w*\s\w*"); //var ele = loc.getelement(); //var parse = ele.gettext();
i'm new both regular expressions , javascript, missing obvious.
a simple method doesn't require regular expressions split on " <br " , take first element:
var parsed_text = body.split('<br')[0];
Comments
Post a Comment