Connecting Tech Pros Worldwide Help | Site Map

regex problem - 2.0 beta 2

Guest
 
Posts: n/a
#1: Nov 19 '05
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]
Guest
 
Posts: n/a
#2: Nov 19 '05

re: regex problem - 2.0 beta 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: <param@community.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: <ObdfZpljFHA.2644@TK2MSFTNGP09.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: corp2.lazardgroup.com 70.182.148.88
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.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
 
Posts: n/a
#3: Nov 19 '05

re: regex problem - 2.0 beta 2


IE:

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

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

PR

"Steven Cheng[MSFT]" <stcheng@online.microsoft.com> wrote in message
news:Bak$$$pjFHA.3472@TK2MSFTNGXA01.phx.gbl...[color=blue]
> 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: <param@community.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: <ObdfZpljFHA.2644@TK2MSFTNGP09.phx.gbl>
> | Newsgroups: microsoft.public.dotnet.framework.aspnet
> | NNTP-Posting-Host: corp2.lazardgroup.com 70.182.148.88
> | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.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!
> |
> |
> |
>[/color]


Steven Cheng[MSFT]
Guest
 
Posts: n/a
#4: Nov 19 '05

re: regex problem - 2.0 beta 2


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[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: <param@community.nospam>
| References: <ObdfZpljFHA.2644@TK2MSFTNGP09.phx.gbl>
<Bak$$$pjFHA.3472@TK2MSFTNGXA01.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: <OoZ0ABtjFHA.2156@TK2MSFTNGP14.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: corp2.lazardgroup.com 70.182.148.88
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP14.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.validationexp ression =
| "^(?!\\d)(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\\W_]).{8,25}$";
|
| FIREFOX:
| ctl00_sitepagecontent_regex_password.validationexp ression =
| "^(?!\\d)(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\\W_]).{8,25}$";Looks the
same
| to me. Any ideas?
|
| PR
|
| "Steven Cheng[MSFT]" <stcheng@online.microsoft.com> wrote in message
| news:Bak$$$pjFHA.3472@TK2MSFTNGXA01.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: <param@community.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: <ObdfZpljFHA.2644@TK2MSFTNGP09.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: corp2.lazardgroup.com 70.182.148.88
| > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.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]
Guest
 
Posts: n/a
#5: Nov 19 '05

re: regex problem - 2.0 beta 2


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[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: <param@community.nospam>
| References: <ObdfZpljFHA.2644@TK2MSFTNGP09.phx.gbl>
<Bak$$$pjFHA.3472@TK2MSFTNGXA01.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: <OoZ0ABtjFHA.2156@TK2MSFTNGP14.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: corp2.lazardgroup.com 70.182.148.88
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP14.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.validationexp ression =
| "^(?!\\d)(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\\W_]).{8,25}$";
|
| FIREFOX:
| ctl00_sitepagecontent_regex_password.validationexp ression =
| "^(?!\\d)(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\\W_]).{8,25}$";Looks the
same
| to me. Any ideas?
|
| PR
|
| "Steven Cheng[MSFT]" <stcheng@online.microsoft.com> wrote in message
| news:Bak$$$pjFHA.3472@TK2MSFTNGXA01.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: <param@community.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: <ObdfZpljFHA.2644@TK2MSFTNGP09.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: corp2.lazardgroup.com 70.182.148.88
| > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.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!
| > |
| > |
| > |
| >
|
|
|

Closed Thread