In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how JavaScript verifies whether the number of types composed of strings is greater than or equal to the value of the parameter num. I hope you will get something after reading this article. Let's discuss it together.
Verify that the number of categories formed by the string is greater than or equal to the value of the parameter num. It is usually used to verify the complexity of the password set by the user.
Verification rules:
The parameter num is the type to be constructed (letters, numbers, punctuation marks), and the value can only be 1-3.
The default parameter num has a value of 1, which means it contains at least one of the letters, numbers, and punctuation marks.
If the value of parameter num is 2, it means that it contains at least 2 kinds of letters, numbers and punctuation marks.
If the value of the parameter num is 3, it means that it must contain letters, numbers and punctuation.
The parameter punctuation refers to the acceptable set of punctuation marks. For specific settings, please refer to the explanation of the punctuation set in the getLIPTypes () method.
Function pureLIP (str,num=1,punctuation=null) {
Let regexp = new RegExp (`[^ A-z0-9 | ${getPunctuation (punctuation)}]`)
Return Boolean (! regexp.test (str) & & getLIPTypes (str,punctuation) > = num)
} what is JavaScript? JavaScript is a literal scripting language whose interpreter is called JavaScript engine and is part of the browser. JavaScript is a scripting language widely used on the client side. It was first used on HTML pages to add dynamic functions to HTML pages.
After reading this article, I believe you have a certain understanding of "how JavaScript verifies whether the number of types composed of strings is greater than or equal to the value of the parameter num". If you want to know more about it, welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.