Need a regex that does not care if less than 6 characters are entered
I have this regex that cause my validation message to fire because it requires 6 characters. I need a Regex that allows any amount of characters:
var unFieldRegEx = /^(?=.*[a-zA-Z\d])(\w|[\.\@\-\?\,\&am开发者_运维技巧p;\''\/\_\""]){6,}$/;
change {6,} to * for 0 or more characters. Change it to + for 1 or more characters.
var unFieldRegEx = /^(?=.*[a-zA-Z\d])(\w|[\.\@\-\?\,\&\''\/\_\""])*$/;
should do it (remove the length specifier @ the end and replace with a *)
精彩评论