473,508 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using Regular Expression Validation

I can't remember the correct way to write a custom regular expression validator, and the help file for VB.net is not terribly helpful...it does not give any real world examples. I've got the main syntax of ^[a-zA-z] but I can't remember how to write the next portion. I need to validate passwords...they must start with a letter of the alphabet, can contain 0-9 and can contain the special characters @#$%&, I just can't remember the correct syntax to write this as a regular expression validation.
Is it ^[a-zA-z]|[a-zA-Z0-9@#$%&] ? I'm not certain about the special characters, they can be in any order as long as the first character is a letter.

Any help/suggestions are greatly appreciated.

TIA, Coleen

---
Posted using Wimdows.net NntpNews Component -

Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.
Nov 18 '05 #1
2 2160
That looks very good for someone who cannot remember Regexes :)

Here's a resource I like for figuring out regexes:
http://devedge.netscape.com/library/...p.html#1193136

The only question I would have is whether you have a minimum size. In that
case, replace the ? with a {min, max} like {4, 20}.

Also add the '$' to the end.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

<Coleen> wrote in message news:u7****************@TK2MSFTNGP11.phx.gbl...
I can't remember the correct way to write a custom regular expression validator, and the help file for VB.net is not terribly helpful...it does
not give any real world examples. I've got the main syntax of ^[a-zA-z] but
I can't remember how to write the next portion. I need to validate
passwords...they must start with a letter of the alphabet, can contain 0-9
and can contain the special characters @#$%&, I just can't remember the
correct syntax to write this as a regular expression validation. Is it ^[a-zA-z]|[a-zA-Z0-9@#$%&] ? I'm not certain about the special characters, they can be in any order as long as the first character is a
letter.
Any help/suggestions are greatly appreciated.

TIA, Coleen

---
Posted using Wimdows.net NntpNews Component -

Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup

engine supports Post Alerts, Ratings, and Searching.
Nov 18 '05 #2
Thanks :-) I took it in class, but it's been months since I've used it, so
I'm not certain it will do everything I need. I do need to check it for
length, thanks very much for the suggestion and link. I appreciate it :-)
"Peter Blum" <PL****@Blum.info> wrote in message
news:eB**************@TK2MSFTNGP11.phx.gbl...
That looks very good for someone who cannot remember Regexes :)

Here's a resource I like for figuring out regexes:
http://devedge.netscape.com/library/...p.html#1193136
The only question I would have is whether you have a minimum size. In that
case, replace the ? with a {min, max} like {4, 20}.

Also add the '$' to the end.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

<Coleen> wrote in message news:u7****************@TK2MSFTNGP11.phx.gbl...
I can't remember the correct way to write a custom regular expression validator, and the help file for VB.net is not terribly helpful...it does
not give any real world examples. I've got the main syntax of ^[a-zA-z]

but I can't remember how to write the next portion. I need to validate
passwords...they must start with a letter of the alphabet, can contain 0-9
and can contain the special characters @#$%&, I just can't remember the
correct syntax to write this as a regular expression validation.
Is it ^[a-zA-z]|[a-zA-Z0-9@#$%&] ? I'm not certain about the special

characters, they can be in any order as long as the first character is a
letter.

Any help/suggestions are greatly appreciated.

TIA, Coleen

---
Posted using Wimdows.net NntpNews Component -

Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup

engine supports Post Alerts, Ratings, and Searching.

Nov 18 '05 #3

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

Similar topics

6
2020
by: christian9997 | last post by:
Hi We have started off using a $_GET parameter to keep track of the user's browser: We detect what browser the visitor is using when he first arrives on our website then we do a redirect to...
2
418
by: Coleen | last post by:
I can't remember the correct way to write a custom regular expression validator, and the help file for VB.net is not terribly helpful...it does not give any real world examples. I've got the main...
5
477
by: tmeister | last post by:
I am in need of a regular expression that tests and fails if there are 14 or more of a character in the test string. There can be up to 13 of these characters in the string and any other...
3
7622
by: Robert Scheer | last post by:
Hi. I have a regularexpression validator control on a page. This regular expression validates a textbox to accept only numbers and commas: validationexpression="*" I am trying to modify this...
18
3015
by: Q. John Chen | last post by:
I have Vidation Controls First One: Simple exluce certain special characters: say no a or b or c in the string: * Second One: I required date be entered in "MM/DD/YYYY" format: //+4 How...
5
3089
by: Ryan | last post by:
HELLO I am using the following MICROSOFT SUGGESTED (somewhere on msdn) regular expression to validate email addresses however I understand that the RFP allows for "+" symbols in the email address...
4
1725
by: Brian Simmons | last post by:
Hi All, I've got a textbox where I want to make sure the person has entered at least 3 characters before submitting (it's like a partial name lookup type of query), so I don't want them to just...
0
1517
by: durga2005 | last post by:
hi i just added one textbox and regular expression validator in the form and set the properties for regular expression validator control. then i placed these two controls inside update panel ....
2
1246
by: i_robot73 | last post by:
I have an ASP .NET (in C# of course :P) that has 4 input boxes: Group (9-digits, EG: 123456789) F. Name (EG: Paul) L. Name (EG: Simpson) LogonID (5678_PSimpson) I'm using the...
0
7388
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...
1
7049
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
7499
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...
1
5055
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...
0
4709
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...
0
3199
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...
0
3186
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1561
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 ...
0
422
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...

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.