I have a form field that contains one , or several "Complete" email addresses. By "Complete" I mean in the format Personal Name <[email protected]>
Multiple "complete" email address are separated by a semi-colon. There may or may not be a final semi-colon at the end of the list. I want to extract the Names into one field and the email addresses into another field.
so :
full_email = "Person name <[email protected]> ; Another person <[email protected]> ; "
email_only is set to "[email protected] ; [email protected] ;"
name_only is set to "Person name ; Another person ;"
Is there some reg exp / jQuery bit of genius to copy everything between the < and > into a second field and everything before the < into a third field and do it iteratively/recursively for the whole list of "complete" email addresses to produce two semi-colon separated lists of just pure email address and just pure names?