Detailed explanation of the usage of php regular modifiers

怪我咯
Release: 2023-03-13 17:20:01
Original
1530 people have browsed it

RegularCommonly used pattern modifiers in expressionsinclude 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 willcharacters The stringis 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;

Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!