Validation Expression to include @hotmail.com

Last post 10-07-2009 1:20 PM by ariejones. 1 replies.

Sort Posts:

  • Validation Expression to include @hotmail.com

    10-07-2009, 11:53 AM
    • Member
      81 point Member
    • arun2033
    • Member since 07-03-2009, 3:52 AM
    • Posts 29

    Hi,

    I have a textbox where I am accepting email address.  

    ValidationExpression="(^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w{2,}$)(?!)"

     

    How would I change it if the string must contain @hotmail.com and should not contain @hotmail.com?

    Thanks in advance.

  • Re: Validation Expression to include @hotmail.com

    10-07-2009, 1:20 PM
    Answer
    • Member
      692 point Member
    • ariejones
    • Member since 06-13-2003, 9:21 AM
    • Indianapolis, IN
    • Posts 117

     The one containing @hotmail.com is easiest...

    ="(^\w+([-+.]\w+)*@hotmail.com)(?!)"

    the one eliminating hotmail would be a little trickier but something like this should work...

    ="(^\w+([-+.]\w+)*@~(hotmail.com)(\w+([-.]\w+)*\.\w{2,}$))(?!)"

     

    the ~() is your don't match piece...

    Cheers,
    AJ

    Arie D. Jones (AJ)
    Principal Technology Manager
    Perpetual Technologies, Inc.
    Blog: ProgrammersEdge.com
    Company Website:perptech.com
Page 1 of 1 (2 items)