开发者

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 *)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜