Strong Password Function

Results 1 to 3 of 3

Thread: Strong Password Function

  1. #1
    Join Date
    Dec 1969
    Posts
    330

    Default Strong Password Function

    I need to create a function that checks to see if a password that the user creates is 'strong' enough. The password must contain an uppercase letter, a lowercase letter, a number and a special character. The part I'm having trouble with is the checking for lower or uppercase. Is there some hidden asp function that I don't know about that might tell me if a lowercase or uppercase character exists in a string? I know that C# has a isLower() function but I don't think ASP does. What would be the best way to test for this? Any help is greatly appreciated. Thanks.

  2. #2
    Join Date
    Dec 1969
    Posts
    95,971

    Default Regular Expressions, of course

    &#060;%<BR>pwd = ...<BR><BR>okay = True<BR><BR>Set re = New RegExp<BR>&#039; first test for a digit<BR>re.Pattern = "d"<BR>okay = okay & re.Test( pwd )<BR>&#039; test for lower case letter<BR>re.Pattern = "[a-z]"<BR>okay = okay & re.Test( pwd )<BR>&#039; test for upper case letter<BR>re.Pattern = "[A-Z]"<BR>okay = okay & re.Test( pwd )<BR>&#039; test for non-letter, non-digit<BR>re.Pattern = "[^A-Za-zd]" &#039; or use [xxx] where xxx is the list of allowable special chars<BR>okay = okay & re.Test( pwd )<BR>If Not okay Then<BR> Response.Write "That password isn&#039;t strong enough"<BR>End If<BR>%&#062;<BR><BR>

  3. #3
    Join Date
    Dec 1969
    Posts
    330

    Default RE: Regular Expressions, of course

    Thanks Bill. I can always count on you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


More ASP Resources

Resources:
-- ASP Articles
-- ASP.NET Information
-- 4Guys ASP F.A.Q.
-- ASPFAQs.com
-- ASP Coding Tips
-- Related Web Technologies
-- User Tips!!
-- JavaScripts


Development Centers
-- HTML5 Development Center
-- Windows Mobile Development Center
-- Android Development Center
-- Cloud Development Project Center


Development Technology
Check out these sites for more articles, tutorials, FAQs, discussions, and code!
-- CodeGuru.com
-- VBForums.com
-- DevX.com
-- Developer.com
-- HTMLGoodies