note 50880 added to function.preg-match
| From: | alcator at seznam dot cz | Date: | Sat, 12 Mar 2005 21:45:34 +0000 |
| Subject: | note 50880 added to function.preg-match | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-86334@lists.php.net to get a copy of this message | ||
How to strip non-alphabetic characters from the beginning and/or end of a string?
Let's say I receive a "chat" sentence "Hello, everybody, how's it going?
:-)"
I explode it by spaces into an array of strings, and then I would like to clean the words as much as
possible of anything non-alphabetic:
Hello, --> Hello
everybody --> everybody
going? --> going
:-) --> [empty]
I could live with "how's", but "hello," is causing me some problems.
Any idea?
Thanks in advance
----
Manual Page -- http://www.php.net/manual/en/function.preg-match.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+50880
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50880&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50880&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50880&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50880&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50880&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+50880&report=yes
Search -- http://master.php.net/manage/user-notes.php