Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7869473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:19:58+00:00 2026-06-03T01:19:58+00:00

I have a form field that contains one , or several Complete email addresses.

  • 0

I have a form field that contains one , or several “Complete” email addresses. By “Complete” I mean in the format Personal Name <person@domain.com>

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 <parson@domain.com> ; Another person <another@domain.com> ; " 
email_only is set to  "parson@domain.com ; another@domain.com ;" 
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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T01:20:00+00:00Added an answer on June 3, 2026 at 1:20 am

    I think you can do this without regex or jQuery by simply splitting on ; to get the entries, then on < to get the parts of the entry. Here’s a jsFiddle to demonstrate.

    var full_email = "Person name <parson@domain.com> ; Another person <another@domain.com> ; " ;
    
    var email_only = [];
    var name_only = [];
    
    var entries = full_email.split(';');
    
    for(var i = 0; i < entries.length; i++)
    {
        var entry = entries[i];
        if (entry.contains('<')){
            var parts = entry.split('<');
    
            name_only.push(parts[0].trim());
            email_only.push(parts[1].substr(0, parts[1].indexOf('>')));
        }
    }
    
    // The arrays
    console.log(email_only);
    console.log(name_only);
    
    // Joined back to ; separated strings
    console.log(email_only.join('; '));
    console.log(name_only.join('; '));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing some form. I have one field in this form that contains a
I have a field in my form labeled Name that will contain both the
I have a form and one of the fields is a check-all-that-applies type field
We have a long page that contains a bunch of different form elements. One
I have a form that contains two input textboxes, one called serial and the
i have a website page that contains only data of which one field gives
I have asp.net form that contains fields. When I access this window, my javascript
I have an asp.net text form that contains numerous decimal fields that are optional.
I have a dijit.form.NumberTextBox input field that starts out with these parms: new dijit.form.NumberTextBox({
I have a form with a hidden Came from Adwords field that will be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.