7 kyu

Password validator

2,335 of 7,526tdowek1

Description:

Description

Your job is to create a simple password validation function, as seen on many websites.

The rules for a valid password are as follows:

  • There needs to be at least 1 uppercase letter.
  • There needs to be at least 1 lowercase letter.
  • There needs to be at least 1 number.
  • The password needs to be at least 8 characters long.

You are permitted to use any methods to validate the password.

Examples:

password("Abcd1234"); ===> true
password("Abcd123"); ===> false
password("abcd1234"); ===> false
password("AbcdefGhijKlmnopQRsTuvwxyZ1234567890"); ===> true
password("ABCD1234"); ===> false
password("Ab1!@#$%^&*()-_+={}[]|\:;?/>.<,"); ===> true;
password("!@#$%^&*()-_+={}[]|\:;?/>.<,"); ===> false;

Extra info

  • You will only be passed strings.
  • The string can contain any standard keyboard character.
  • Accepted strings can be any length, as long as they are 8 characters or more.
Fundamentals
Regular Expressions
Algorithms

Stats:

CreatedJan 27, 2016
PublishedJan 30, 2016
Warriors Trained11028
Total Skips134
Total Code Submissions21996
Total Times Completed7526
JavaScript Completions2335
Ruby Completions124
Python Completions4825
C# Completions143
C++ Completions197
Total Stars115
% of votes with a positive feedback rating93% of 661
Total "Very Satisfied" Votes571
Total "Somewhat Satisfied" Votes82
Total "Not Satisfied" Votes8
Ad
Contributors
  • tdowek1 Avatar
  • GiacomoSorbi Avatar
  • hobovsky Avatar
  • user8436785 Avatar
  • Just4FunCoder Avatar
  • saudiGuy Avatar
Ad