In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article is about the usefulness of\ w and\ d in regular expressions. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
I believe many people know about regular expressions, but the first feeling of many people is that it is difficult to learn, because at first glance, they feel that there are no rules to find, and they are all a bunch of all kinds of special symbols.
Solve the confusion of regular expressions\ w and\ d https://www.jb51.net/article/154754.htm
In fact, it's just that you don't know about the regularity. if you understand it, you will find that there are not many related characters used in the regularization, and it is not difficult to remember and even more difficult to understand. the only difficulty is that after the combination, the readability is relatively poor, and it is not easy to understand. The purpose of this article is to make people have a basic understanding of regularities, can understand simple regular expressions, and can write simple regular expressions. It can be used to meet the needs of daily development.
What is a regular expression
A regular expression is a special string pattern used to match a set of strings, just like using a mold to make a product, and the regular is the mold that defines a rule to match characters that match the rules.
After consulting many relevant regular descriptions, it is found that the definition of\ w is that it contains uppercase and lowercase letters and numbers and underscores are equivalent to ([0-9a-zA-Z]).
(based on the classic tutorial regular expression 30-minute introductory tutorial)
However, in practical use, it is found that this is not the case, and it can also be said that it not only contains these data ([0-9amurzAMurZZ]).
The following is the test screenshot tool editplus:
In fact, it also contains Greek letters, Russian letters, etc., in addition to ([0-9a murz Amurz]).
Therefore, if you need to pay attention to the specific matching data when registering user information, you must not directly use\ w to get it done.
Thank you for reading! This is the end of the article on "what is the use of\ w and\ d in regular expressions". I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it for more people to see!
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.