In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you what are the special characters of PHP regular expressions. I hope you will get something after reading this article. Let's discuss it together.
The PHP regular expression special characters "[]" and "\", so what are they? What is the specific operation? Why they are special characters, is there anything special in the process of using them? Let's take a look at the introduction.
Two other important special characters are "[]". They can match characters that have appeared in "[]", such as "/ [az] /" can match a single character "a" or "z"; if you change the above expression to this "/ [a murz] /", you can match any single lowercase letter, such as "a", "b", and so on.
About the PHP regular expression special character "[]":
If "^" appears in "[]", it means that this expression does not match the characters that appear in "[]", such as "/ [^ amurz] /" does not match any lowercase letters! And the regular expression gives several default values for "[]":
◆ [: alpha:]: matches any letter
◆ [: alnum:]: matches any letter and number
◆ [: digit:]: matches any number
◆ [: space:]: matches the space character
◆ [: upper:]: matches any capital letter
◆ [: lower:]: matches any lowercase letter
◆ [: punct:]: matches any punctuation mark
◆ [: xdigit:]: matches any hexadecimal number
About the PHP regular expression special character "\":
The following special characters are represented by the escape symbol "\" as follows:
◆ s: matches a single space character
◆ S: used to match all characters except a single space character.
◆ d: used to match numbers from 0 to 9, equivalent to "/ [0-9] /".
◆ w: used to match letters, numbers, or underscore characters, equivalent to "/ [a-zA-Z0-9] /".
◆ W: used to match all characters that do not match w, equivalent to "/ [^ a-zA-Z0-9] /".
◆ D: used to match any non-decimal numeric character.
.◆: used to match all characters except newline characters, if modified by the modifier "s", "." Can represent any character.
After reading this article, I believe you have a certain understanding of "what are the special characters of PHP regular expressions". If you want to know more about it, you are 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.