Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2008

Tip: Looking for answers? Try searching our database.

Regular Expression for a password

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joe - 11 Feb 2008 17:23 GMT
Hello,

I want to verify that a password is:
- Minimum 7 characters (can be any character)
- Includes at least 1 number.

I thought this would work but it does seem to:
^(?=.*[a-z])(?=.*[A-Z]).{7,}$

Thanks,
Joe
Jesse Houwing - 11 Feb 2008 19:10 GMT
Hello Joe,

> Hello,
>
[quoted text clipped - 5 lines]
> Thanks,
> Joe

There is no check for a number in there at all....

^(?=.*[0-9]).{7,}$

should do the trick.

--
Jesse Houwing
jesse.houwing at sogeti.n
lue - 11 Feb 2008 19:37 GMT
Joe
see this link
http://davidhayden.com/blog/dave/archive/2004/09/25/501.aspx
password complexity in your applications:
^.*(?=.{7,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=]).*$

The regular expression enforces the following rules:

 a.. Must be at least 7 characters
 b.. Must contain at least one one lower case letter, one upper case
letter, one digit and one special character
 c.. Valid special characters (which are configurable) are -   @#$%^&+=

Regards

Lue

> Hello,
>
[quoted text clipped - 7 lines]
> Thanks,
> Joe

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.