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 / Languages / C# / March 2008

Tip: Looking for answers? Try searching our database.

Regex password

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Robert Bravery - 18 Mar 2008 13:51 GMT
Hi all,

Trying to validate a password with a regularexpressionvalidator
But cant get the regex to work correctly
I' look for a Alpha-numeric password of at least 7 in length and no upper
limit in length

Thanks
Robert
Ethan Strauss - 18 Mar 2008 15:19 GMT
I belive that
           Regex Passwords = new Regex("\w{7,}");
will do it.
That is:
  Any word character (all letters, all numerals)
  At least 7 of them.
  No upper limit.
Ethan

> Hi all,
>
[quoted text clipped - 5 lines]
> Thanks
> Robert
Jeroen - 18 Mar 2008 15:23 GMT
Haven't tested, but this might start you off :-)

string alphaNum = "[a-zA-Z0-9_]";
string pattern = "";
pattern += alphaNum + alphaNum + alphaNum + alphaNum;
pattern += alphaNum + alphaNum + alphaNum;
pattern += alphaNum + "*";
pattern += "$";

Regards,
Jeroen

Rate this thread:







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.