Given a string, how can I match all e-mails thar are inside “< >”.
For example:
I can have xxx@abc.com and <yyy@abc.com> and I only want to match the yyy@abc.com.
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
To be really thorough you could implement a regex from RFC822, which describes valid email address formats, however, you could save time and headache by doing something quick and simple like this:
Of course, this function will be very permissive of strings that might conceivably even remotely look like an email address, so the regular expression “r” could be improved if quality is a concern.