note 59535 added to function.preg-match-all
| From: | php at projectjj dot com | Date: | Fri, 09 Dec 2005 08:43:32 +0000 |
| Subject: | note 59535 added to function.preg-match-all | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-99802@lists.php.net to get a copy of this message | ||
Re: webmaster at swirldrop dot com
If you want to get a string with all the 'normal' characters, this may be better:
$clean = preg_replace('/\W+/', '', $dirty);
\W is the opposite of \w and will match any character that is not a letter or digit or the
underscore character, plus it respects the current locale. Use [^0-9a-zA-Z]+ instead of \W if you
need ASCII-only.
----
Manual Page -- http://www.php.net/manual/en/function.preg-match-all.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+59535
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+59535&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+59535&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+59535&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+59535&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+59535&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+59535&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+59535&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+59535&report=yes
Search -- http://master.php.net/manage/user-notes.php