title: Google app script regex to split first and last names
body: <p>I'm using a google app script to pull data from an email to the a sheet. Part of the body of the email comes in with this line "Name*: first last".</p>
  
  <p>I've got this line that pulls out the name, but I'd like to actually pull out "first" and "last" names separately. I'm thinking you can do that somehow with regex. </p>
  
  <pre><code>var name = messages[j].getPlainBody().split("Name*: ")[1].split("\n")[0];
  </code></pre>
  
  <p>I'm trying to do this with:</p>
  
  <pre><code>var fName = messages[j].getPlainBody().split("Name*: ")[1].str.split(/\s(.+)/)[0];
  var lName = messages[j].getPlainBody().split("Name*: HOW TO SKIP FIRST NAME ")[1].split("\n")[0];
  </code></pre>
  
  <p>Having some difficulty. Little help. Thanks.</p>