regex problem - 2.0 beta 2

Discussion in 'ASP .Net' started by Guest, Jul 22, 2005.

  1. Guest

    Guest Guest

    Here is an interesting one. Running asp.net 2.0 beta 2. I have a regular
    expression used in a regex validator that works on the client side in
    Firefox but not in IE. Any ideas? IE always reports the field is invalid.
    The expression is:


    ^(?!\d)(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\W_]).{8,25}$

    If I enter "Test_Field1" Firefox considers it valid on client side, IE
    doesnt. Server side considers it valid too because when I submit the form in
    Firefox I am presuming it is checked on server-side too?

    TIA!
     
    Guest, Jul 22, 2005
    #1
    1. Advertising

  2. Hi Param,

    Welcome to ASPNET newsgroup.
    As for the regular expression validation problem you mentioned, does it
    also occur when using 1.1 validator? Also, based on my understanding, it is
    likely the outputed regular expression is somewhat changed(escaped or....).
    Have you compare the html source in the client browsers to see whether
    there're any difference?

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    --------------------
    | From: <>
    | Subject: regex problem - 2.0 beta 2
    | Date: Thu, 21 Jul 2005 20:10:07 -0500
    | Lines: 15
    | X-Priority: 3
    | X-MSMail-Priority: Normal
    | X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
    | X-RFC2646: Format=Flowed; Original
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
    | Message-ID: <>
    | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | NNTP-Posting-Host: corp2.lazardgroup.com 70.182.148.88
    | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
    | Xref: TK2MSFTNGXA01.phx.gbl
    microsoft.public.dotnet.framework.aspnet:113746
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    |
    | Here is an interesting one. Running asp.net 2.0 beta 2. I have a regular
    | expression used in a regex validator that works on the client side in
    | Firefox but not in IE. Any ideas? IE always reports the field is invalid.
    | The expression is:
    |
    |
    | ^(?!\d)(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\W_]).{8,25}$
    |
    | If I enter "Test_Field1" Firefox considers it valid on client side, IE
    | doesnt. Server side considers it valid too because when I submit the form
    in
    | Firefox I am presuming it is checked on server-side too?
    |
    | TIA!
    |
    |
    |
     
    Steven Cheng[MSFT], Jul 22, 2005
    #2
    1. Advertising

  3. Guest

    Guest Guest

    IE:

    ctl00_sitepagecontent_regex_password.validationexpression =
    "^(?!\\d)(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\\W_]).{8,25}$";

    FIREFOX:
    ctl00_sitepagecontent_regex_password.validationexpression =
    "^(?!\\d)(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\\W_]).{8,25}$";Looks the same
    to me. Any ideas?

    PR

    "Steven Cheng[MSFT]" <> wrote in message
    news:Bak$$$...
    > Hi Param,
    >
    > Welcome to ASPNET newsgroup.
    > As for the regular expression validation problem you mentioned, does it
    > also occur when using 1.1 validator? Also, based on my understanding, it
    > is
    > likely the outputed regular expression is somewhat changed(escaped
    > or....).
    > Have you compare the html source in the client browsers to see whether
    > there're any difference?
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    > --------------------
    > | From: <>
    > | Subject: regex problem - 2.0 beta 2
    > | Date: Thu, 21 Jul 2005 20:10:07 -0500
    > | Lines: 15
    > | X-Priority: 3
    > | X-MSMail-Priority: Normal
    > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
    > | X-RFC2646: Format=Flowed; Original
    > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
    > | Message-ID: <>
    > | Newsgroups: microsoft.public.dotnet.framework.aspnet
    > | NNTP-Posting-Host: corp2.lazardgroup.com 70.182.148.88
    > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
    > | Xref: TK2MSFTNGXA01.phx.gbl
    > microsoft.public.dotnet.framework.aspnet:113746
    > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    > |
    > | Here is an interesting one. Running asp.net 2.0 beta 2. I have a regular
    > | expression used in a regex validator that works on the client side in
    > | Firefox but not in IE. Any ideas? IE always reports the field is
    > invalid.
    > | The expression is:
    > |
    > |
    > | ^(?!\d)(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\W_]).{8,25}$
    > |
    > | If I enter "Test_Field1" Firefox considers it valid on client side, IE
    > | doesnt. Server side considers it valid too because when I submit the
    > form
    > in
    > | Firefox I am presuming it is checked on server-side too?
    > |
    > | TIA!
    > |
    > |
    > |
    >
     
    Guest, Jul 22, 2005
    #3
  4. Thanks for your followup Param,

    I've also performed some tests on my local environment based on the regex
    you provided. I'd have to admit that this is
    a exiting problem of the regular expression support of the IE browser. Even
    we direct use some simple script to validate it as below:

    function test() {
    var re = new
    RegExp("^(?!\\d)(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\\W_]).{8,25}$");
    var m = re.exec("Test_Field1");
    if (m == null) {
    alert("No match");
    } else {
    var s = "Match at position " + m.index + ":\n";
    for (i = 0; i < m.length; i++) {
    s = s + m + "\n";
    }
    alert(s);
    }

    }

    Also, currently I think the problem will still remain in the IE and we need
    to workaround it through some other means such as using serverside
    validation. Sorry for the inconvience it brings you.

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)


    --------------------
    | From: <>
    | References: <>
    <Bak$$$>
    | Subject: Re: regex problem - 2.0 beta 2
    | Date: Fri, 22 Jul 2005 10:14:05 -0500
    | Lines: 72
    | X-Priority: 3
    | X-MSMail-Priority: Normal
    | X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
    | X-RFC2646: Format=Flowed; Original
    | Message-ID: <>
    | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | NNTP-Posting-Host: corp2.lazardgroup.com 70.182.148.88
    | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP14.phx.gbl
    | Xref: TK2MSFTNGXA01.phx.gbl
    microsoft.public.dotnet.framework.aspnet:113827
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    |
    | IE:
    |
    | ctl00_sitepagecontent_regex_password.validationexpression =
    | "^(?!\\d)(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\\W_]).{8,25}$";
    |
    | FIREFOX:
    | ctl00_sitepagecontent_regex_password.validationexpression =
    | "^(?!\\d)(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\\W_]).{8,25}$";Looks the
    same
    | to me. Any ideas?
    |
    | PR
    |
    | "Steven Cheng[MSFT]" <> wrote in message
    | news:Bak$$$...
    | > Hi Param,
    | >
    | > Welcome to ASPNET newsgroup.
    | > As for the regular expression validation problem you mentioned, does it
    | > also occur when using 1.1 validator? Also, based on my understanding,
    it
    | > is
    | > likely the outputed regular expression is somewhat changed(escaped
    | > or....).
    | > Have you compare the html source in the client browsers to see whether
    | > there're any difference?
    | >
    | > Steven Cheng
    | > Microsoft Online Support
    | >
    | > Get Secure! www.microsoft.com/security
    | > (This posting is provided "AS IS", with no warranties, and confers no
    | > rights.)
    | >
    | > --------------------
    | > | From: <>
    | > | Subject: regex problem - 2.0 beta 2
    | > | Date: Thu, 21 Jul 2005 20:10:07 -0500
    | > | Lines: 15
    | > | X-Priority: 3
    | > | X-MSMail-Priority: Normal
    | > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
    | > | X-RFC2646: Format=Flowed; Original
    | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
    | > | Message-ID: <>
    | > | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | > | NNTP-Posting-Host: corp2.lazardgroup.com 70.182.148.88
    | > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
    | > | Xref: TK2MSFTNGXA01.phx.gbl
    | > microsoft.public.dotnet.framework.aspnet:113746
    | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    | > |
    | > | Here is an interesting one. Running asp.net 2.0 beta 2. I have a
    regular
    | > | expression used in a regex validator that works on the client side in
    | > | Firefox but not in IE. Any ideas? IE always reports the field is
    | > invalid.
    | > | The expression is:
    | > |
    | > |
    | > | ^(?!\d)(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\W_]).{8,25}$
    | > |
    | > | If I enter "Test_Field1" Firefox considers it valid on client side, IE
    | > | doesnt. Server side considers it valid too because when I submit the
    | > form
    | > in
    | > | Firefox I am presuming it is checked on server-side too?
    | > |
    | > | TIA!
    | > |
    | > |
    | > |
    | >
    |
    |
    |
     
    Steven Cheng[MSFT], Jul 26, 2005
    #4
    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. Mark Oliver

    install Beta 2 after Beta 1?

    Mark Oliver, Jan 25, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    409
    Scott Allen
    Jan 25, 2005
  2. Replies:
    1
    Views:
    2,199
    Bruce Barker
    May 3, 2005
  3. Eugene Toporov
    Replies:
    0
    Views:
    759
    Eugene Toporov
    Jul 15, 2004
  4. David Dorward
    Replies:
    0
    Views:
    584
    David Dorward
    Jul 12, 2005
  5. Replies:
    3
    Views:
    807
    Reedick, Andrew
    Jul 1, 2008
Loading...

Share This Page