Reputation: 30293
In my application I validate emails; but we can give more than one email address separated with a semicolon (";"). How can I write the validation expression?
My emails look like this:
"[email protected];[email protected];[email protected] "
How can I write a regular expression for this?
Upvotes: 0
Views: 1858
Reputation: 25790
You can give this a try:
\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*([,;]\s*\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)*
This is from RegexLib.com
Upvotes: 0
Reputation: 798456
Start with the basic email regex and then apply as follows:
<email regex>(;<email regex>)*
Upvotes: 1