473,395 Members | 2,006 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.

RegularExpressionValidator Issues

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

Has anyone else had issues with the RegularExpressionValidator 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 1463
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 RegularExpressionValidator 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***************@TK2MSFTNGP05.phx.gbl...
I'm trying to use a asp:RegularExpressionValidator to validate the
strength of a password. When I test the regular expression with
Regex.IsMatch, it works perfectly. However, when used within a
RegularExpressionValidator, it always returns false.

Has anyone else had issues with the RegularExpressionValidator 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
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...
3
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
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"...
0
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...
3
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...
0
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...
1
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 =...
4
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...
4
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...
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...
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
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...
0
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...
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...
0
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,...

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.