473,800 Members | 2,304 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

RegularExpressi onValidator Issues

I'm trying to use a asp:RegularExpr essionValidator to validate the
strength of a password. When I test the regular expression with
Regex.IsMatch, it works perfectly. However, when used within a
RegularExpressi onValidator, it always returns false.

Has anyone else had issues with the RegularExpressi onValidator not
correctly parsing a regular expression?

The regular expression I am using is:
"^.*(?=.*\d)|(? =.*[^a-zA-Z0-9])|(?=.*[A-Z])(?=.*[a-z])(?=.{8,}).*$"

Thanks
Jul 17 '06 #1
1 1494
John,

I'm not 100% positive about this, but if I'm thinking clearly try removing
the caret "^" at the beginning of your regular expression and the dollar
sign "$" at the end. I believe they are needed when using Regex.IsMatch, but
I believe that the RegularExpressi onValidator adds them for you.

Let us know if that was it...

Regards,

--
S. Justin Gengo
Web Developer / Programmer

Free code library:
http://www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"John Yopp" <jy***@nowhere. comwrote in message
news:%2******** *******@TK2MSFT NGP05.phx.gbl.. .
I'm trying to use a asp:RegularExpr essionValidator to validate the
strength of a password. When I test the regular expression with
Regex.IsMatch, it works perfectly. However, when used within a
RegularExpressi onValidator, it always returns false.

Has anyone else had issues with the RegularExpressi onValidator not
correctly parsing a regular expression?

The regular expression I am using is:
"^.*(?=.*\d)|(? =.*[^a-zA-Z0-9])|(?=.*[A-Z])(?=.*[a-z])(?=.{8,}).*$"

Thanks

Jul 17 '06 #2

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

Similar topics

0
3017
by: Andy Eshtry | last post by:
I have a radio button list, a textbox representing SIN or EIN based on my radio button list selection so I put 2 regularexpressionvalidator to evaluate the value of textbox. EIN must be (for simplicity) with this format (2 digits) like 12 (ValidationExpression="\d{3}-\d{2}") and SIN must be (for simplicity) with this format (3digits-2digits) like 123-45 (ValidationExpression="\d{3}-\d{2}") It works well. The problem is: When I...
3
3798
by: Ricardo Corsi P. Cesar | last post by:
Hi, i looking for example in asp.net (VB) to make the RegularExpressionValidator in runtime in my code behind. I found some similars codes, but nothing in VB.. thanks!
3
2028
by: DC | last post by:
I have this snippet: <tr> <td align="left">E-mail</td> <td> <asp:TextBox id="txtEmail" runat="server" MaxLength="100"></asp:TextBox>&nbsp; <asp:RegularExpressionValidator id="revEmail" runat="server" ErrorMessage="Enter a valid e-mail address" ControlToValidate="txtEmail"
0
1359
by: Matt Morris | last post by:
Hello: I have a RegularExpressionValidator control attached to a TextBox. I have the ValidationExpression property set to a very simple validation expression (\w+). The validation always fails when entering Greek characters. When I test this expression in a standalone test harness, it accepts the Greek characters just fine. It is my understanding that the RegEx class in the Framework is by default culture sensitive and I assume the...
3
3682
by: tshad | last post by:
I have a RegularExpressionValidator that doesn't seem to work correctly if you don't enter anything. In the following, it works correctly if you have at least 1 character. If you just enter through the field it lets you (even thoug no entry would be less that 6 characters. <asp:textbox id="password1" TextMode="Password" Columns="45" runat="server" /><asp:label text=" 6-20 characters with at least 1 numeric" style="color:red"...
0
1164
by: venkat Murthy | last post by:
Hi, I have 10 regularexpression validators in my datagrid. my datagrid looks like; first5controls | boundcolumn | next5controls. Regularexpressionvalidator for first five controls works fine. But, it throws wierd errors when the error message is caught for next5controls.
1
1849
by: franz | last post by:
does anybody tell me why it doesn't works?? in any case gg beame true thanks franz Dim y As RegularExpressionValidator = New RegularExpressionValidator y.ValidationExpression = "^\w+(\w+)*@\w+(\w+)*\.\w+(\w+)*$" y.ControlToValidate = "ss5ssss" Dim gg As Boolean = y.IsValid
4
6057
by: =?Utf-8?B?Y3VyaW91cw==?= | last post by:
I am using a RegularExpressionValidator to validate a TextBox. I use "^?+(\.*)?$" to check for a real number. The control works fine as long as the user enters something in the TextBox; it does not work if the user leaves the TextBox blank. Is there a bug in the implementation of the RegularExpressionValidator? The above regluar expression should also catch no entry by the user. I have added a RequiredFieldValidator to solve the...
4
2114
by: =?Utf-8?B?RGF2ZSBXZWVkZW4=?= | last post by:
Hi, I seem to have found a bug in the regular expression validator under firefox 2.0.0.15 when I use saved form field values. Specifically I have an email address validator for a text box that uses the expression below. ^\s*(+\.)*+@(+\.)+{2,4}\s*$ When I first enter an email address such as a@b.com everything works as expected. On subsequent visits to the form, when I type the 'a' character
0
10275
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10033
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...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7576
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
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5471
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...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
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
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.