473,394 Members | 1,935 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,394 software developers and data experts.

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 2158
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
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
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
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
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
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
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
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
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
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...

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.