In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "what do I, m, s, x, e in php rules represent?" the content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what do I, m, s, x, e in php rules represent respectively?"
I
If you set this modifier, the characters in the pattern will match both uppercase and lowercase letters.
M
When this modifier is set, Line start and Line end match not only the beginning and end of the entire string, but also after and before the newline character, respectively.
S
If this modifier is set, the dot metacharacter (.) in the pattern matches all characters, including newline characters. Without this setting, newline characters are not included.
X
If this modifier is set, the white space characters in the pattern are completely ignored except those that are escaped or in the character class, and all characters between # and the next newline character, including both ends, outside the unescaped character class.
E
If this modifier is set, preg_replace () replaces the reverse reference normally in the replacement string
? In. + and * indicate a non-greedy match: *, + and? Qualifiers are greedy because they match as many words as possible, only adding one after them. Non-greedy or minimal matching can be achieved.
For example:
Example: (? I):
(? I) in PHP means internal corrector, and I means case-insensitive
Other modifiers include xrem, mrem, s, U and so on. It's the same as the pattern modifier we use.
The difference is that it is used internally in the pattern. Works only in the submode in which (? I) is located
Such as
Ccc (a (? I)) bcd matches cccabcd and cccAbcd
And a (? I) bc is the same as abc plus the\ I modifier because (? I) acts on the whole pattern.
Backward reference
Adding parentheses to both sides of a regular expression pattern or partial pattern causes related matches to be stored in a temporary buffer, with each captured submatch stored according to what is encountered from left to right in the regular expression pattern. The buffer number of the storage sub-match starts at 1 and is numbered up to a maximum of 99 subexpressions. Each buffer can be accessed using'\ n', where n is an one-or two-digit decimal number that identifies a particular buffer.
You can use non-capture metacharacters'?:','? =', or'?!' To ignore the saving of related matches.
Thank you for your reading, the above is the content of "what I, m, s, x, e represent respectively in php rule". After the study of this article, I believe you have a more profound understanding of what I, m, s, x, e represent in php rule, and the specific use still needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.