Home  >  Article  >  Backend Development  >  Detailed explanation of the usage of php regular modifiers

Detailed explanation of the usage of php regular modifiers

怪我咯
怪我咯Original
2017-07-12 11:51:261463browse

RegularCommonly used pattern modifiers in expressions include i, g, m, s, x, e, etc. They can be used in combination.
Their functions are as follows:
//Modifier: i case-insensitive matching;
//Modifier: g represents global matching
//Modifier: m will characters The string is treated as multiple lines, and it can be matched no matter which line it is;
//Modifier: s treats the string as a single line, and the newline character is treated as an ordinary character;
//Modifier: x treats the pattern Blank spaces in are ignored;
//Modifier:A forces matching from the beginning of the target string;
//Modifier:D If $ is used to limit the ending character, no newline at the end is allowed;
// Modifier: U only matches the most recent string; does not match repeatedly;

The above is the detailed content of Detailed explanation of the usage of php regular modifiers. For more information, please follow other related articles on the PHP Chinese website!

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 [email protected]