473,795 Members | 2,924 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_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!
Nov 19 '05 #1
4 1365
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!
|
|
|

Nov 19 '05 #2
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!
|
|
|

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

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

Nov 19 '05 #5

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

Similar topics

14
2924
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 is: /\w+(-?\w+)*/ Test cases that I expect to pass are failing: "01234abcdef" true
9
4592
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
1756
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 version 2.0 returns incorrect results. I have this string: value,Var,],'Text',,pro(a,b,c)
4
5976
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 thrown at it but today during a test, a bracket "}" passed through the method as a valid guid so I wanted to know if this expresion will stop invalid guids or did I miss something? __systemGUID is the string passed in.
6
2503
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 the right parts in there in one big line and for some reason that did not work either. Here is my regex's. static Regex rar = new Regex("\\.part.*", RegexOptions.IgnoreCase); static Regex par = new Regex("\\.vol.*", RegexOptions.IgnoreCase);
7
2590
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 slash then some numbers. For some reason I am not getting that. It won't work at all in 2.0
4
333
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
2702
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 RN(name, regex): """protect using () and give an optional name to a regex""" if name:
15
50264
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
9673
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10443
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10165
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10002
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7543
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3728
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2921
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.