Guest User

Untitled

a guest
Nov 4th, 2018
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. const
  2. /**
  3. * Letters (a-z), numbers (0-9), and periods (._-) are allowed.
  4. * Can't start or end with periods. Contains at least 2 letters before and after (@).
  5. * Sub-domains with two characters are allowed.
  6. */
  7. email: /^([a-z\d]+[._-]?[a-z\d]+)+@[a-z\d]+[-]?[a-z\d]+(\.[a-z\d]{2,})+$/i,
  8.  
  9. /**
  10. * Minimum 8 characters, including numbers and letters in both registers.
  11. * Examples:
  12. * – ThisIsMyPassword1
  13. * – qweRt123
  14. * ...
  15. */
  16. password: /^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})/,
  17.  
  18. /**
  19. * Phone number from 9 to 10 digits, with or without country code separated with space.
  20. * Country code with leading (00) or (+).
  21. * Examples:
  22. * – 0034 654123789
  23. * – +34 654123789
  24. * – 654123789
  25. */
  26. phone: /^((\+|00)[1-9]{1,3} )?[0-9]{9,10}$/,
  27.  
  28. /**
  29. * Single or multiple surnames separated with spaces.
  30. * Minimum 2 letters, accent characters allowed.
  31. * Examples:
  32. * – Lopez Martín
  33. * – Smith
  34. * – Li
  35. */
  36. surnames: /^(([A-zÀ-ÿ]{2,}|[A-Z].) ?)?$/,
  37.  
  38. /**
  39. * Single or multiple names separated with spaces.
  40. * Minimum 2 letters, accent characters allowed.
  41. * Examples:
  42. * – José Antonio
  43. * – John
  44. * – Wu
  45. */
  46. name: /^(([A-zÀ-ÿ]{2,}|[A-Z].) ?)?$/,
  47.  
  48. /**
  49. * Letters (a-z), numbers (0-9), and periods (_-) are allowed.
  50. * Minimum 3 characters.
  51. * Examples:
  52. * – jane_doe-9
  53. * – JA-lopez
  54. * – abc
  55. */
  56. username: /^[a-zA-Z0-9\-_]{3,}$/;
Add Comment
Please, Sign In to add comment