Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const
- /**
- * Letters (a-z), numbers (0-9), and periods (._-) are allowed.
- * Can't start or end with periods. Contains at least 2 letters before and after (@).
- * Sub-domains with two characters are allowed.
- */
- email: /^([a-z\d]+[._-]?[a-z\d]+)+@[a-z\d]+[-]?[a-z\d]+(\.[a-z\d]{2,})+$/i,
- /**
- * Minimum 8 characters, including numbers and letters in both registers.
- * Examples:
- * – ThisIsMyPassword1
- * – qweRt123
- * ...
- */
- password: /^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})/,
- /**
- * Phone number from 9 to 10 digits, with or without country code separated with space.
- * Country code with leading (00) or (+).
- * Examples:
- * – 0034 654123789
- * – +34 654123789
- * – 654123789
- */
- phone: /^((\+|00)[1-9]{1,3} )?[0-9]{9,10}$/,
- /**
- * Single or multiple surnames separated with spaces.
- * Minimum 2 letters, accent characters allowed.
- * Examples:
- * – Lopez Martín
- * – Smith
- * – Li
- */
- surnames: /^(([A-zÀ-ÿ]{2,}|[A-Z].) ?)?$/,
- /**
- * Single or multiple names separated with spaces.
- * Minimum 2 letters, accent characters allowed.
- * Examples:
- * – José Antonio
- * – John
- * – Wu
- */
- name: /^(([A-zÀ-ÿ]{2,}|[A-Z].) ?)?$/,
- /**
- * Letters (a-z), numbers (0-9), and periods (_-) are allowed.
- * Minimum 3 characters.
- * Examples:
- * – jane_doe-9
- * – JA-lopez
- * – abc
- */
- username: /^[a-zA-Z0-9\-_]{3,}$/;
Add Comment
Please, Sign In to add comment