I know that in normal php regex (ASCII mode) "\\w" (word) means "letter, number, and _". But what does it mean when you are using multibyte regex with the "u" modifier ?
preg_replace('/\W/u', '', $string);
Anything that isn't a letter, number or underscore.
So, in terms of Unicode character classes, \\W
is equivalent to every character that are not in the L or N character classes and that aren't the underscore character.
If you were to write it using the \\p{xx}
syntax, it would be equivalent to [^\\p{LN}_]
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.