validation.js 403 B

12345678910111213141516
  1. module.exports = {
  2. regex: {
  3. azAZ09_: /^[A-Za-z0-9_]+$/,
  4. az09_: /^[a-z0-9_]+$/,
  5. emailSimple: /^[\x00-\x7F]+@[a-z0-9]+\.[a-z0-9]+(\.[a-z0-9]+)?$/,
  6. password: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$@$!%*?&])[A-Za-z\d$@$!%*?&]/,
  7. ascii: /^[\x00-\x7F]+$/
  8. },
  9. isLength: (string, min, max) => {
  10. return !(
  11. typeof string !== "string" ||
  12. string.length < min ||
  13. string.length > max
  14. );
  15. }
  16. };