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);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Anything that isn’t a letter, number or underscore.
So, in terms of Unicode character classes,
\Wis 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}_].