regex problem - 2.0 beta 2

G

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!
 
S

Steven Cheng[MSFT]

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: <[email protected]>
| 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: <[email protected]>
| 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!
|
|
|
 
G

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
 
S

Steven Cheng[MSFT]

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: <[email protected]>
| References: <[email protected]>
<[email protected]>
| 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: <[email protected]>
| 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
|
| | > 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: <[email protected]>
| > | 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: <[email protected]>
| > | 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!
| > |
| > |
| > |
| >
|
|
|
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top