note 68974 added to function.preg-match
| From: | Izzy at osu1 dot php dot net | Date: | Thu, 17 Aug 2006 19:27:07 +0000 |
| Subject: | note 68974 added to function.preg-match | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-116019@lists.php.net to get a copy of this message | ||
Concerning the German umlauts (and other language-specific chars as accented letters etc.): If you
use unicode (utf-8), you can match them easily with the unicode character property \pL (match any
unicode letter) and the "u" modifier, so e.g.
<?php preg_match("/[\w\pL]/u",$var); ?>
would really match all "words" in $var - whether they contain umlauts or not. Took me a
while to figure this out, so maybe this comment will safe the day for someone else :-)
----
Server IP: 212.124.37.9
Probable Submitter: 84.152.153.155
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.preg-match.php
Edit -- https://master.php.net/note/edit/68974
Del: integrated -- https://master.php.net/note/delete/68974/integrated
Del: useless -- https://master.php.net/note/delete/68974/useless
Del: bad code -- https://master.php.net/note/delete/68974/bad+code
Del: spam -- https://master.php.net/note/delete/68974/spam
Del: non-english -- https://master.php.net/note/delete/68974/non-english
Del: in docs -- https://master.php.net/note/delete/68974/in+docs
Del: other reasons-- https://master.php.net/note/delete/68974
Reject -- https://master.php.net/note/reject/68974
Search -- https://master.php.net/manage/user-notes.php