note 83822 rejected from ref.regex by mgf
| From: | mgf@php.net | Date: | Fri, 13 Jun 2008 15:29:43 +0000 |
| Subject: | note 83822 rejected from ref.regex by mgf | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-140410@lists.php.net to get a copy of this message | ||
Note Submitter: Unicode guy
----
php at erikjan dot net said that to test for a whole word, use [[:<:]]yourword[[:>:]]
But it doesn't work with Unicode characters. Does anyone have a way to do it with Unicode?
In other words
// If $pattern is supposed to be a whole word
if ($pattern == utf8_encode($pattern))
$pattern = "[[:<:]]{$pattern}[[:>:]]";
else
$pattern = ?????????????????????? // That's the missing link
Thanks!