note 113888 added to function.preg-match
| From: | IvenMarquardt | Date: | Fri, 13 Dec 2013 09:57:30 +0000 |
| Subject: | note 113888 added to function.preg-match | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-197924@lists.php.net to get a copy of this message | ||
if you want to match all printable ascii (0..127) expect some specific chars, try this:
<?php
$excluded = '\$a';
echo preg_replace('~[^' . $excluded . '[:^print:]]~', '',
'abc123ABC!?$%/â¬');
?>
result: a$â¬
----
Server IP: 72.52.91.14
Probable Submitter: 72.52.91.14
----
Manual Page -- http://php.net/manual/en/function.preg-match.php
Edit -- https://master.php.net/note/edit/113888
Del: integrated -- https://master.php.net/note/delete/113888/integrated
Del: useless -- https://master.php.net/note/delete/113888/useless
Del: bad code -- https://master.php.net/note/delete/113888/bad+code
Del: spam -- https://master.php.net/note/delete/113888/spam
Del: non-english -- https://master.php.net/note/delete/113888/non-english
Del: in docs -- https://master.php.net/note/delete/113888/in+docs
Del: other reasons-- https://master.php.net/note/delete/113888
Reject -- https://master.php.net/note/reject/113888
Search -- https://master.php.net/manage/user-notes.php