Regex Validators for Strings
Username
- starts with alphanumeric character
- has a min-length of 3 and max-length of 30
- can contain '.-_ ' except as first character
Password is complex
- contains at least one alphabetic character
- contains at least one digit or a non-alphabetic character
- is beetween 5 and 50 characters long
- can contain anything else if rules 1-3 apply
Email is valid
Returns true if email matches pattern x@y.z where:
- x, y: alphabetic characters, numbers and characters
- z: only alphabetic characters, min-length is 2
Regex Validators for Numbers
Date ISO/DIN
- matches iso format, i.e. 2015-08-30
- matches german DIN, i.e. 30.08.2015
Time
- matches 24h format, i.e. 18:15, 2:00 etc.
- matches 12h format, i.e. 6:15pm, 12:00am etc
Copyright Jan Suwart, MIT license