I am working to validate a string of email addresses. This pattern works fine if there is only one email address:
var pattern = /^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$/;
But if I have two email addresses separated by space or by a newline, then it does not validate. For example:
xyz@abc.com xyz@bbc.com
or
xyz@abc.com
xyz@bbc.com
Can you please tell me what would be a way to do it? I am new to regular expressions.
Help much appreciated! Thanks.