Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera
Created May 24, 2018 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uno-de-piera/74b6042d23a2e8f4080e42f6e7ec625c to your computer and use it in GitHub Desktop.
Save uno-de-piera/74b6042d23a2e8f4080e42f6e7ec625c to your computer and use it in GitHub Desktop.
import { Validator } from 'vee-validate';
Validator.extend('verify_password', {
getMessage: password => `La contraseña debe contener al menos: 1 letra mayúscula, 1 letra minúscula, 1 número y un carácter especial`,
validate: value => {
const strongRegex = new RegExp("^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})");
return strongRegex.test(value);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment