Regular expression for email to allow only two domain

I have to create a regular expression for email id like this

xyz@yahoo.com and xyz@gmail.com

I need to allow only yahoo and gmail as the domain not any other domain. I have used this expression \w+([-+.]\w+)*@yahoo.com . It is working fine for yahoo. but I want to include gmail also. How can I modify it to except gmail also?

I am using ASP.NET 2.0

Answers


Replace:

yahoo\.com

with:

(yahoo\.com|gmail\.com)

or:

(yahoo|gmail)\.com)

Need Your Help

Handling large amount of data and processes in multiprocessing

python numpy multiprocessing large-files

So after long considerations and try-outs, I'm once again asking the pros.