Home >Backend Development >PHP Tutorial >php regular expression-correction pattern

php regular expression-correction pattern

WBOY
WBOYOriginal
2016-08-08 09:22:461150browse

"Correction mode" is to specify a matching mode for the regular expression matching process, similar to the mode of mobile phones (family mode, conference mode, etc.):
Contains the following:
"Greedy matching" - means that when the matching results are ambiguous (multiple results appear), it will choose the result with the longest result;
"Lazy matching (U)" - means that when the matching result is ambiguous (multiple results appear), it will choose the result with the shortest result;
"i"——Ignore the upper and lower case of English letters in regular expressions;
"x" - ignore whitespace in regular expressions;
"s" - Let the metacharacter '.' match all characters including newlines;

If no correction mode is specified for the regular expression, the regular expression uses "greedy mode" by default;

The above introduces the PHP regular expression-correction mode, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:php zmq extensionNext article:php zmq extension