Jump to content

js regex to pull an email address


smerny

Recommended Posts

I have a string that can be

 

"Billy Bob <[email protected]>"

 

or

 

"[email protected]"

 

how can I make it so that if it is like the first example, it will just pull the email address?

 

Does any sanitation need to be done to the string? Will the string always contain a valid email address or is this unreliable data that needs to be checked for a valid email address as well?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.