note 104582 added to function.preg-match

From: Date: Fri, 24 Jun 2011 00:56:40 +0000
Subject: note 104582 added to function.preg-match
Groups: php.notes 
Request: Send a blank email to php-notes+get-180897@lists.php.net to get a copy of this message
Basic test for invalid UTF-8 that can hi-jack IE: <?php $valid = (preg_match('/^./us', $text) == 1); ?> See http://api.drupal.org/api/drupal/includes--bootstrap.inc/function/drupal_validate_utf8/7 for details. --- Test for valid UTF-8 and XML/XHTML character range compatibility: <?php $invalid = preg_match('@[^\x9\xA\xD\x20-\x{D7FF}\x{E000}-\x{FFFD}\x{10000}-\x{10FFFF}]@u', $text) ?> Ref: http://www.w3.org/TR/2000/REC-xml-20001006#charsets ---- Server IP: 217.160.235.204 Probable Submitter: 91.20.208.191 ---- Manual Page -- http://www.php.net/manual/en/function.preg-match.php Edit -- https://master.php.net/note/edit/104582 Del: integrated -- https://master.php.net/note/delete/104582/integrated Del: useless -- https://master.php.net/note/delete/104582/useless Del: bad code -- https://master.php.net/note/delete/104582/bad+code Del: spam -- https://master.php.net/note/delete/104582/spam Del: non-english -- https://master.php.net/note/delete/104582/non-english Del: in docs -- https://master.php.net/note/delete/104582/in+docs Del: other reasons-- https://master.php.net/note/delete/104582 Reject -- https://master.php.net/note/reject/104582 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#180897) next »