ValidationExpression

Discussion in 'ASP .Net' started by =?Utf-8?B?SklNLkgu?=, Nov 17, 2004.

  1. ValidationExpression="\d{2}/\d{2}/\d{4}" how can you make this work for date
    exactly. Taking care of Feb for example?
     
    =?Utf-8?B?SklNLkgu?=, Nov 17, 2004
    #1
    1. Advertising

  2. Check :-http://www.regexlib.com
    GDLUCK

    "JIM.H." wrote:

    > ValidationExpression="\d{2}/\d{2}/\d{4}" how can you make this work for date
    > exactly. Taking care of Feb for example?
    >
     
    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=, Nov 17, 2004
    #2
    1. Advertising

  3. =?Utf-8?B?SklNLkgu?=

    bruce barker Guest

    try:

    "^(?:(?:(?:0?[13578]|1[02])(\/|-|\.)31)\1|(?:(?:0?[1,3-9]|1[0-2])(\/|-|\.)(?
    :29|30)\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})$|^(?:0?2(\/|-|\.)29\3(?:(?:(?:1[6-9]
    |[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])
    00))))$|^(?:(?:0?[1-9])|(?:1[0-2]))(\/|-|\.)(?:0?[1-9]|1\d|2[0-8])\4(?:(?:1[
    6-9]|[2-9]\d)?\d{2})$"


    doesn't require leading zero, allows 2 digit years and a date seperator of
    "." or "/" or "-". feel free to edit to your needs



    -- bruce (sqlwork.com)





    "JIM.H." <> wrote in message
    news:...
    | ValidationExpression="\d{2}/\d{2}/\d{4}" how can you make this work for
    date
    | exactly. Taking care of Feb for example?
    |
     
    bruce barker, Nov 17, 2004
    #3
  4. Hi Bruce..
    What about if i want to validate an email like:-
    ?



    "bruce barker" wrote:

    > try:
    >
    > "^(?:(?:(?:0?[13578]|1[02])(\/|-|\.)31)\1|(?:(?:0?[1,3-9]|1[0-2])(\/|-|\.)(?
    > :29|30)\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})$|^(?:0?2(\/|-|\.)29\3(?:(?:(?:1[6-9]
    > |[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])
    > 00))))$|^(?:(?:0?[1-9])|(?:1[0-2]))(\/|-|\.)(?:0?[1-9]|1\d|2[0-8])\4(?:(?:1[
    > 6-9]|[2-9]\d)?\d{2})$"
    >
    >
    > doesn't require leading zero, allows 2 digit years and a date seperator of
    > "." or "/" or "-". feel free to edit to your needs
    >
    >
    >
    > -- bruce (sqlwork.com)
    >
    >
    >
    >
    >
    > "JIM.H." <> wrote in message
    > news:...
    > | ValidationExpression="\d{2}/\d{2}/\d{4}" how can you make this work for
    > date
    > | exactly. Taking care of Feb for example?
    > |
    >
    >
    >
     
    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=, Nov 18, 2004
    #4
  5. =?Utf-8?B?SklNLkgu?=

    Peter Blum Guest

    <flame>I wish Microsoft would do a better job documenting the purpose of the
    CompareValidator because this question appears regularly!</flame>

    The CompareValidator validates the format of dates, integers, and currency.
    It handles dates exactly the way you need. Just set its Operator to
    DataTypeCheck and Type to the desired format.

    --- Peter Blum
    www.PeterBlum.com
    Email:
    Creator of "Professional Validation And More" at
    http://www.peterblum.com/vam/home.aspx

    "JIM.H." <> wrote in message
    news:...
    > ValidationExpression="\d{2}/\d{2}/\d{4}" how can you make this work for
    > date
    > exactly. Taking care of Feb for example?
    >
     
    Peter Blum, Nov 18, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?T2xpdmVyIFNjaHVsemU=?=

    ValidationExpression Syntax

    =?Utf-8?B?T2xpdmVyIFNjaHVsemU=?=, May 12, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    1,204
    =?Utf-8?B?T2xpdmVyIFNjaHVsemU=?=
    May 12, 2004
  2. TD
    Replies:
    3
    Views:
    8,718
  3. Replies:
    3
    Views:
    705
    Rad [Visual C# MVP]
    Nov 17, 2006
  4. Nathan Sokalski
    Replies:
    2
    Views:
    905
    Nathan Sokalski
    Jan 3, 2007
  5. Morten71
    Replies:
    0
    Views:
    639
    Morten71
    Apr 2, 2007
Loading...

Share This Page