In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Most people do not understand the knowledge points of this article "what I refer to in php rules", so the editor summarizes the following contents, detailed content, clear steps, and has a certain reference value. I hope you can gain something after reading this article. Let's take a look at this "what I mean in php rules" article.
In PHP, the "I" of the regular expression is the abbreviation of "in-casesensitive", which means "case-sensitive" and is a modifier in the regular expression; when this modifier is set in the regular expression, the character indicating that the regular expression is matched will match both uppercase and lowercase letters, and the syntax is "/ match condition / I".
This article operating environment: Windows10 system, PHP7.1 version, Dell G3 computer
What does I mean in php rule
I here is a regular expression.
I: indicates in-casesensitive, that is, case insensitive
If you set this modifier, the characters in the pattern will match both uppercase and lowercase letters.
For example:
$reg ='/ {5} / I'
Expand knowledge:
A regular expression is a matching pattern, and the regular expression itself is a string (made up of some grammatical rules and special symbols).
The string of regular expressions must be used in the corresponding function to make sense (a combination of segmentation and replacement functions)
1. Delimiter / /
2. The smallest matching unit of the atom (in / /, in the regular expression, there is at least one. For example: $reg ='/ 7 /')
3. Metacharacters metacharacters cannot be used alone. Metacharacters are used to modify meta-characters, and to expand atomic functions and limit words as supplementary instructions (for example: $reg ='/ {5} /'in assist delimiters)
4. Pattern modifier correction, pattern (regular) correction (written outside the delimiter, written on the right, for example: I in $reg ='/ {5} / I')
Examples are as follows:
1. Non-empty matching'/. + /'
2. Floating point matching (2 bits reserved)'/ (?! 0\ .00) (\ d +\. D {2} $) /'
$subject = ['1.00,' 2.345, '0.23, 234, 23.22, 0.00']; $matche = []; for ($I = 0; $I < count ($subject); $iTunes +) {if (preg_match (' / (?! 0\ .00) (\ d+\.\ d {2} $) /', $subject [$I], $matche) {show ($matche);}
Results:
3. Mobile phone number
'/ ^ 1 (3 | 4 | 7 | 8)\ d {9} $/'
4. Email address
'/ ^ ([0-9A-Za-z\\-_\\.] +) @ ([0-9a-z] +\. [amurz] {2jue 3} (\. [amurz] {2})?) $/ i'
Or
'/ ^\ w+ (\.\ w+) * @\ w+ (\.\ w+) + $/'
5. Common URL addresses
'/ ^ (https?://)? (\ w\.) + [a-zA-Z] + $/' is the content of this article about "what I mean in php rules". I believe you all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.
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.