Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2005

Tip: Looking for answers? Try searching our database.

regex problem - 2.0 beta 2

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
param@community.nospam - 22 Jul 2005 02:10 GMT
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] - 22 Jul 2005 10:30 GMT
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

Signature

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
[quoted text clipped - 10 lines]
| 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
|
[quoted text clipped - 10 lines]
|
| TIA!
param@community.nospam - 22 Jul 2005 16:14 GMT
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,
>
[quoted text clipped - 47 lines]
> |
> | TIA!
Steven Cheng[MSFT] - 26 Jul 2005 08:27 GMT
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

Signature

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
[quoted text clipped - 9 lines]
| 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
|
[quoted text clipped - 61 lines]
| > |
| > | TIA!

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.