note 49926 deleted from function.preg-match by tularis
| From: | tularis@php.net | Date: | Thu, 03 Jul 2008 21:39:46 +0000 |
| Subject: | note 49926 deleted from function.preg-match by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-141149@lists.php.net to get a copy of this message | ||
Note Submitter: info at reiner-keller dot de
----
Pointing to the post of "internet at sourcelibre dot com": Instead of using PerlRegExp for
e.g. german "Umlaute" like
<?php
$bolMatch = preg_match("/^[a-zA-ZäöüÄÖÜ]+$/", $strData);
?>
use the setlocal command and the POSIX format like
<?php
setlocale (LC_ALL, 'de_DE');
$bolMatch = preg_match("/^[[:alpha:]]+$/", $strData);
?>
This works for any country related special character set.
Remember since the "Umlaute"-Domains have been released it's almost mandatory to
change your RegExp to give those a chance to feed your forms which use "Umlaute"-Domains
(e-mail and internet address).
Live can be so easy reading the manual ;-)