note 66034 added to function.preg-match
| From: | peter at etherface dot com | Date: | Fri, 12 May 2006 16:32:49 +0000 |
| Subject: | note 66034 added to function.preg-match | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-111192@lists.php.net to get a copy of this message | ||
Howdy All:
I am trying to write a regular expression to basically process dvd titles. For example if I have
The Great Mouse Detectives I would like to display Great Mouse Detectives, The
I have a function that does almost what I need but when there is a special character i.e(
.,!@#$%...) it breaks.
A.I. Artificial Intelligence => .I. Artificial Intelligence, A
Is there a way that I can get preg_match to exclude a set of characters after it matches the
âAâ?
preg_match("/\b$needle\b/i", strtolower($haystack))
$needle is âaâ or âanâ or âtheâ and $haystack is the original title.
Any help would be awesome!!!
----
Server IP: 216.194.113.175
Probable Submitter: 216.57.65.20
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.preg-match.php
Edit -- http://master.php.net/note/edit/66034
Del: integrated -- http://master.php.net/note/delete/66034/integrated
Del: useless -- http://master.php.net/note/delete/66034/useless
Del: bad code -- http://master.php.net/note/delete/66034/bad+code
Del: spam -- http://master.php.net/note/delete/66034/spam
Del: non-english -- http://master.php.net/note/delete/66034/non-english
Del: in docs -- http://master.php.net/note/delete/66034/in+docs
Del: other reasons-- http://master.php.net/note/delete/66034
Reject -- http://master.php.net/note/reject/66034
Search -- http://master.php.net/manage/user-notes.php