Email and Password Validation Intrinsics
New string intrinsic methods .IsValidEmail and .IsValidPassword(Medium/Strong) can be used to validate a field or a string used as an email address or a password.
.IsValidEmail Rules
- The address cannot be more than 254 characters long.
- The address must not contain more than one "@", double dots ("..") or begin with a "@" or "."
- The address cannot have any spaces or end with a "."
- There must be at least 1 character between "@" and "." as domain
- There must be at least one dot in an email address after @
- The part preceding @ cannot be more than 64 characters long, contain any of "( ) , : ; < > [ \"] " characters or end with a "."
.IsValidPassword( password Strength: Medium/ Strong ) Rules
This method has two enum parameters Medium and Strong which are mandatory and must be set.
Medium password rules:
- Password length must be at least 6 characters long.
- Password should contain at least one lowercase and one uppercase alphabetical character, or at least one lowercase and one numeric character, or at least one uppercase and one numeric character.
Strong password rules:
- Password length must be at least 8 characters long.
- Password must contain one uppercase, one lowercase, one numeric and one special character.
- Special characters are " @$!%*?& "