Skip to content

Instantly share code, notes, and snippets.

@iamtonysoft
Created May 8, 2020 00:37
Show Gist options
  • Save iamtonysoft/99d51d5f356142addd740c3863acb4bc to your computer and use it in GitHub Desktop.
Save iamtonysoft/99d51d5f356142addd740c3863acb4bc to your computer and use it in GitHub Desktop.
//mobile number
let mobileREGEX = /^(09|\+639)\d{9}$/;
let result = mobileREGEX.test($('#mobileNumber').val());
if (result === true) {
return true;
} else {
return false;
}
//password policy
let passRegex = data.Rules;
let _regEx = new RegExp(passRegex);
let result = _regEx.test($('#newPass').val());
if (result === true) {
return true;
} else {
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment