Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Added: Apr 4, 2019 11:12 AM
Modified: Apr 4, 2019 11:13 AM
Views: 24
  1. // URL
  2. /^(\A|[^=\]\'\"a-zA-Z0-9])((http|ftp|https|ftps|irc):\/\/[^()<>\s]+)$/i;
  3.  
  4. // HEX color
  5. /^([0-9a-fA-F]{3,6})|([0-9a-fA-F]{3,6})$/i;
  6.  
  7. // Email
  8. /^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,6}$/i;
  9.  
  10. // Phone
  11. /^((8|\+7|7)[\- ]?)?(\(?\d{3}\)?[\- ]?)?[\d\- ]{7,10}$/i;
  12.  
  13. // Date
  14. /^\d{4}-\d{1,2}-\d{1,2}$/;
  15.  
  16. // Password
  17. // Minimum eight characters, at least one letter and one number:
  18. /^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$/;
  19. // Minimum eight characters, at least one letter, one number and one special character:
  20. /^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*#?&])[A-Za-z\d@$!%*#?&]{8,}$/;
  21. // Minimum eight characters, at least one uppercase letter, one lowercase letter and one number:
  22. /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,}$/;
  23. // Minimum eight characters, at least one uppercase letter, one lowercase letter, one number and one special character:
  24. /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/;
  25. // Minimum eight and maximum 10 characters, at least one uppercase letter, one lowercase letter, one number and one special character:
  26. /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,10}$/;
  27.