How can I trim a string(6) \" page\", where the first whitespace is a 0xc2a0 non-breaking space?
I\'ve tried trim() and preg_match(\'
PCRE unicode properties properties can be used to achieve this
Here is the code that I played with and seems to do what you want:
Result
[~]> php e.php
string(6) "#page#"
Explanation:
\p{xx} a character with the xx property \P{xx} a character without the xx property
If xx has only one character, then {} can be dropped, e.g. \p{Z} is the same as \pZ
Z stands for all separators, C stands for all "other" characters (for example control characters)