note 49926 added to function.preg-match

From: Date: Sat, 12 Feb 2005 06:03:14 +0000
Subject: note 49926 added to function.preg-match
Groups: php.notes 
Request: Send a blank email to php-notes+get-84891@lists.php.net to get a copy of this message
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 ;-) ---- Manual Page -- http://www.php.net/manual/en/function.preg-match.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+49926 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+49926&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49926&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+49926&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+49926&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+49926&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+49926&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#84891) next »