Email RegularExpression not working

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Email RegularExpression not working

    The email reg exp that ships with the RegularExpressionValidator doesnt like
    this email address:

    [email]user@blah.ru[/email]

    Or any other email domain that contains only 2 letters after the dot.

    It *looks* like it should (I notice the qualifier at the end of the
    statement for 2 or more letters), but the validator always fires anyway.
    Anyone else notice similar behavior or do I just need some sleep?




    Learning SQL Server Guest

  2. Similar Questions and Discussions

    1. 'Send a review' email not working
      When my client attempts to 'Send a review' via email, she gets the following email message: The server could not be found. Account:...
    2. #15373 [Com]: mail() not working, no error with invalid SMTP or email address
      ID: 15373 Comment by: doug32x at hotmail dot com Reported By: alonso at admintek dot net Status: No Feedback...
    3. Mailto: with query for email list not working
      I am managing a website for a membership-based organization and one of the things I am doing for them is giving them an easy way to email to the...
    4. ASP Email - CDONTS - AttachFile - Getting it embeded in the email
      I am unable to get my file attachment in the email => Here is what my code looks like - which is very simple from the documentation that I have...
    5. Email from website function not working
      I used Publisher to create a website in which I want to be able for users to complete a form, press the submit button and the site will then email...
  3. #2

    Default Re: Email RegularExpression not working

    try validationExpression="\S+@\S+\.\S{2,3}"



    "Learning SQL Server" <no.mail.com> wrote in message
    news:ueVefkOXDHA.536@TK2MSFTNGP10.phx.gbl...
    > The email reg exp that ships with the RegularExpressionValidator doesnt
    like
    > this email address:
    >
    > [email]user@blah.ru[/email]
    >
    > Or any other email domain that contains only 2 letters after the dot.
    >
    > It *looks* like it should (I notice the qualifier at the end of the
    > statement for 2 or more letters), but the validator always fires anyway.
    > Anyone else notice similar behavior or do I just need some sleep?
    >
    >
    >
    >

    Seaside Guest

  4. #3

    Default Re: Email RegularExpression not working

    This is the one I use:

    [\w-.]+?@([\w-]+?\.)+[\w]{2,}

    I've tested it fairly extensively, including a couple of embarassing
    incidents where potential customers trying to register emailed me to tell me
    that my form wouldn't accept their email address, resulting in the included
    regular expression.

    I haven't had any emails for a while now to tell me I'm rejecting valid
    addresses.

    Colin

    "Learning SQL Server" <no.mail.com> wrote in message
    news:ueVefkOXDHA.536@TK2MSFTNGP10.phx.gbl...
    > The email reg exp that ships with the RegularExpressionValidator doesnt
    like
    > this email address:
    >
    > [email]user@blah.ru[/email]
    >
    > Or any other email domain that contains only 2 letters after the dot.
    >
    > It *looks* like it should (I notice the qualifier at the end of the
    > statement for 2 or more letters), but the validator always fires anyway.
    > Anyone else notice similar behavior or do I just need some sleep?
    >
    >
    >
    >

    Colin Young Guest

  5. #4

    Default Re: Email RegularExpression not working

    Colin:
    I was looking at another expression *sheepish grin*


    "Colin Young" <x@nospam.com> wrote in message
    news:OqNdToQXDHA.536@TK2MSFTNGP10.phx.gbl...
    > This is the one I use:
    >
    > [\w-.]+?@([\w-]+?\.)+[\w]{2,}
    >
    > I've tested it fairly extensively, including a couple of embarassing
    > incidents where potential customers trying to register emailed me to tell
    me
    > that my form wouldn't accept their email address, resulting in the
    included
    > regular expression.
    >
    > I haven't had any emails for a while now to tell me I'm rejecting valid
    > addresses.
    >
    > Colin
    >
    > "Learning SQL Server" <no.mail.com> wrote in message
    > news:ueVefkOXDHA.536@TK2MSFTNGP10.phx.gbl...
    > > The email reg exp that ships with the RegularExpressionValidator doesnt
    > like
    > > this email address:
    > >
    > > [email]user@blah.ru[/email]
    > >
    > > Or any other email domain that contains only 2 letters after the dot.
    > >
    > > It *looks* like it should (I notice the qualifier at the end of the
    > > statement for 2 or more letters), but the validator always fires anyway.
    > > Anyone else notice similar behavior or do I just need some sleep?
    > >
    > >
    > >
    > >
    >
    >

    Learning SQL Server Guest

  6. #5

    Default Re: Email RegularExpression not working

    "Learning SQL Server" <no.mail.com> wrote in
    news:ueVefkOXDHA.536@TK2MSFTNGP10.phx.gbl:
    > The email reg exp that ships with the RegularExpressionValidator
    > doesnt like this email address:
    >
    > [email]user@blah.ru[/email]
    >
    > Or any other email domain that contains only 2 letters after the
    > dot.
    >
    > It *looks* like it should (I notice the qualifier at the end of
    > the statement for 2 or more letters), but the validator always
    > fires anyway. Anyone else notice similar behavior or do I just
    > need some sleep?
    Here's a regex I use to validate e-mail addresses:

    ^[-a-zA-Z0-9][-.a-zA-Z0-9]*@[-.a-zA-Z0-9]+(\.[-.a-zA-Z0-
    9]+)*\.(com|edu|info|gov|int|mil|net|org|biz|name|mu seum|coop|aero|pr
    o|[a-zA-Z]{2})$


    Hope this helps.

    Chris.
    -------------
    C.R. Timmons Consulting, Inc.
    [url]http://www.crtimmonsinc.com/[/url]
    Chris R. Timmons Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139