Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.9k views
in Technique[技术] by (71.8m points)

求教js正则校验问题

js校验同时包含三项(大、小写字母,数字)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

"js校验同时包含三项(大、小写字母,数字)"是指必须同时含有大小写字母和数字?

var regExp = /(?=.*[a-z])(?=.*[A-Z])(?=.*d)/;

// Test
regExp.test('2az') // false
regExp.test('2aZ') // true

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...