Answers for "Password validation"

C#
0

javascript password validation special character

function CheckPassword(inputtxt) 
{ 
var paswd=  /^(?=.*[0-9])(?=.*[!@#$%^&*])[a-zA-Z0-9!@#$%^&*]{7,15}$/;
if(inputtxt.value.match(paswd)) 
{ 
alert('Correct, try another...')
return true;
}
else
{ 
alert('Wrong...!')
return false;
}
}
Posted by: Guest on October-20-2020
2

Javascript validate password

let pattern = new RegExp("^(?=(.*[a-zA-Z]){1,})(?=(.*[0-9]){2,}).{8,}$"); //Regex: At least 8 characters with at least 2 numericals
    let inputToListen = document.getElementById('pass-one'); // Get Input where psw is write
    let valide = document.getElementsByClassName('indicator')[0]; //little indicator of validity of psw

    inputToListen.addEventListener('input', function () { // Add event listener on input
        if(pattern.test(inputToListen.value)){
            valide.innerHTML = 'ok';
        }else{
            valide.innerHTML = 'not ok'
        }
    });
Posted by: Guest on October-09-2020
0

Password validation

using System.Text.RegularExpressions;
public class Program
{
    public static bool ValidatePassword(string password)
    {
	  return Regex.IsMatch(password,
		@"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?!.*(\S)\1)(?!.*è).{6,24}$");
    }
}
//Length between 6 and 24 characters.
//At least one uppercase letter (A-Z).
//At least one lowercase letter (a-z).
//At least one digit (0-9).
//Maximum of 2 repeated characters.
//"aa" is OK 
//"aaa" is NOT OK
Posted by: Guest on July-25-2021
0

password validation with regular expression in javascript

var strongRegex = new RegExp("^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})");
Posted by: Guest on May-05-2020
-1

html password and username

#Check the above or below to know.
Posted by: Guest on August-10-2020

Code answers related to "Password validation"

C# Answers by Framework

Browse Popular Code Answers by Language