I’m looking for a RegEx for multiple line email addresses.
For example:
1) Single email:
johnsmith@email.com - ok
2) Two line email:
johnsmith@email.com
karensmith@emailcom - ok
3) Two line email:
john smith@email.com - not ok
karensmith@emailcom
I’ve tried the following:
((\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*(\r\n)?)+)\r*
But when I test it, it seems to still match ok if there is 1 valid email address as in example 3.
I need a rule which states all email addresses must be valid.
How about:
Check the beginning of the string using ‘^’ and the end using ‘$’.
Allow an optional whitespace character with ‘\s?’.
Try out http://myregexp.com/signedJar.html for testing regex expressions.