note 83822 added to ref.regex
| From: | Unicodeguy at osu1 dot php dot net | Date: | Fri, 13 Jun 2008 14:56:47 +0000 |
| Subject: | note 83822 added to ref.regex | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-140409@lists.php.net to get a copy of this message | ||
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!
----
Server IP: 82.80.248.162
Probable Submitter: 62.219.97.89
----
Manual Page -- http://www.php.net/manual/en/ref.regex.php
Edit -- https://master.php.net/note/edit/83822
Del: integrated -- https://master.php.net/note/delete/83822/integrated
Del: useless -- https://master.php.net/note/delete/83822/useless
Del: bad code -- https://master.php.net/note/delete/83822/bad+code
Del: spam -- https://master.php.net/note/delete/83822/spam
Del: non-english -- https://master.php.net/note/delete/83822/non-english
Del: in docs -- https://master.php.net/note/delete/83822/in+docs
Del: other reasons-- https://master.php.net/note/delete/83822
Reject -- https://master.php.net/note/reject/83822
Search -- https://master.php.net/manage/user-notes.php