note 66034 rejected from function.preg-match by nlopess
| From: | nlopess@php.net | Date: | Fri, 12 May 2006 16:49:21 +0000 |
| Subject: | note 66034 rejected from function.preg-match by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-111193@lists.php.net to get a copy of this message | ||
Note Submitter: peter at etherface dot com
----
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!!!