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_F ield1");
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[i] + "\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: <pa***@communit y.nospam>
| References: <Ob************ **@TK2MSFTNGP09 .phx.gbl>
<Ba************ **@TK2MSFTNGXA0 1.phx.gbl>
| 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: <Oo************ **@TK2MSFTNGP14 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: corp2.lazardgro up.com 70.182.148.88
| Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP14.phx. gbl
| Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1138 27
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| IE:
|
| ctl00_sitepagec ontent_regex_pa ssword.validati onexpression =
| "^(?!\\d)(?=.*\ \d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\\W_]).{8,25}$";
|
| FIREFOX:
| ctl00_sitepagec ontent_regex_pa ssword.validati onexpression =
| "^(?!\\d)(?=.*\ \d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\\W_]).{8,25}$";Look s the
same
| to me. Any ideas?
|
| PR
|
| "Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
| news:Ba******** ******@TK2MSFTN GXA01.phx.gbl.. .
| > 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: <pa***@communit y.nospam>
| > | 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: <Ob************ **@TK2MSFTNGP09 .phx.gbl>
| > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| > | NNTP-Posting-Host: corp2.lazardgro up.com 70.182.148.88
| > | Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP09.phx. gbl
| > | Xref: TK2MSFTNGXA01.p hx.gbl
| > microsoft.publi c.dotnet.framew ork.aspnet:1137 46
| > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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_Field 1" 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!
| > |
| > |
| > |
| >
|
|
|