473,395 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

regex problem - 2.0 beta 2

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!
Nov 19 '05 #1
4 1346
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***@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: <Ob**************@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!
|
|
|

Nov 19 '05 #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]" <st*****@online.microsoft.com> wrote in message
news:Ba**************@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: <pa***@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: <Ob**************@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!
|
|
|

Nov 19 '05 #3
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: <pa***@community.nospam>
| References: <Ob**************@TK2MSFTNGP09.phx.gbl>
<Ba**************@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: <Oo**************@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]" <st*****@online.microsoft.com> wrote in message
| news:Ba**************@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: <pa***@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: <Ob**************@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!
| > |
| > |
| > |
| >
|
|
|

Nov 19 '05 #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[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***@community.nospam>
| References: <Ob**************@TK2MSFTNGP09.phx.gbl>
<Ba**************@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: <Oo**************@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]" <st*****@online.microsoft.com> wrote in message
| news:Ba**************@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: <pa***@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: <Ob**************@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!
| > |
| > |
| > |
| >
|
|
|

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: enrique | last post by:
I'm trying to debug my expression that matches an alphanumeric with any number of dashes (including none), except at the ends and obviously disallowing two or more consecutive dashes. Here it...
9
by: Tim Conner | last post by:
Is there a way to write a faster function ? public static bool IsNumber( char Value ) { if (Regex.IsMatch( Value.ToString(), @"^+$" )) { return true; } else return false; }
0
by: Hugo Wetterberg | last post by:
Hi, I've got a problem with RegEx in the 2.0 Beta. I have a regexp expression that works fine in the 1.1 version of the framework but breaks in 2.0. I'm no regexp guru, so I don't really know why...
4
by: Greg Merideth | last post by:
I came up with this to test strings passed into a checking method to see if the guid being passed in (regular 128 bit windows registry GUID) is valid. So far it seems to handle most errors...
6
by: Extremest | last post by:
I have a huge regex setup going on. If I don't do each one by itself instead of all in one it won't work for. Also would like to know if there is a faster way tried to use string.replace with all...
7
by: Extremest | last post by:
I am using this regex. static Regex paranthesis = new Regex("(\\d*/\\d*)", RegexOptions.IgnoreCase); it should find everything between parenthesis that have some numbers onyl then a forward...
4
by: Bill Mill | last post by:
Hello all, I've got a test script: ==== start python code ===== tests2 = def test_re(regex): r = re.compile(regex, re.MULTILINE)
3
by: aspineux | last post by:
My goal is to write a parser for these imaginary string from the SMTP protocol, regarding RFC 821 and 1869. I'm a little flexible with the BNF from these RFC :-) Any comment ? tests= def...
15
by: morleyc | last post by:
Hi, i would like to remove a number of characters from my string (\t \r \n which are throughout the string), i know regex can do this but i have no idea how. Any pointers much appreciated. Chris
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.