Validating Email

Hi I want to validate emails and I know how by using....


I need to validate only 4 different types of domains.,,, and

I got this from another expert....

pattern="^[_a-z0-9-]+(\.[_a-z0-9-]+)* | ^[_a-z0-9-]+(\.[_a-z0-9-]+)* | ^[_a-z0-9-]+(\.[_a-z0-9-]+)* | ^[_a-z0-9-]+(\.[_a-z0-9-]+)*"

unfortunately it doesn't work...

I need another suggestion....
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

How about this:

Very similar, but with minor variations - because really that is the answer if you want to use the regular expression you stated.

^[_a-z0-9-]+(\.[_a-z0-9-]+)*$ | ^[_a-z0-9-]+(\.[_a-z0-9-]+)*@wduq.orgu$ | ^[_a-z0-9-]+(\.[_a-z0-9-]+)*$ | ^[_a-z0-9-]+(\.[_a-z0-9-]+)*$

If it doesn't work then show some examples that are not working that you need to validate...
James RodgersWeb Applications DeveloperCommented:
how about this?

pattern="^[_a-z0-9-]+(\.[_a-z0-9-]+)*@( | | |$"
nau2ndAuthor Commented:
it still is not working

here is an email i try to input....i tried both solutions above and both will give me the validating message.

<cfinput type="text" name="EmpEmail" required="yes"
            pattern="^[_a-z0-9-]+(\.[_a-z0-9-]+)*$ | ^[_a-z0-9-]+(\.[_a-z0-9-]+)*@wduq.orgu$ | ^[_a-z0-9-]+(\.[_a-z0-9-]+)*$ | ^[_a-z0-9-]+(\.[_a-z0-9-]+)*$"
            message="Please enter your Duquesne email address. For questions or to reports problems please contact Kathy Jaczesko at 412-396-5311 or" value="" size="49">
How about this expression?

<cfset RE = "^['_a-z0-9-]+(\.['_a-z0-9-]+)*@(duq\.edu|wduq\.org|library\.duq\.edu|mathcs\.duq\.edu)$"/>

Returns 1:
#reFindNoCase(RE, "")#

Returns 0:
#reFindNoCase(RE, "")#
#reFindNoCase(RE, "")#


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The pattern I suggested, works with the examples provided by nau2nd. Therefore it is very likely to be the answer to the question.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.