Re: hot to use perg_match with multi strign patern
| From: | Jason k Larson | Date: | Wed, 07 May 2003 11:17:12 +0000 |
| Subject: | Re: hot to use perg_match with multi strign patern | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-146648@lists.php.net to get a copy of this message | ||
Sure enough ... I wasn't looking that closely. The syntax in the match is specific to perl regular expressions. Don't use eregi use preg_match. If you need the case-insensitive matching use the trailing i.
if (preg_match('/\b(got|am)\b/i', $mesage, $matches))
Of course, Ernest already gave you this example.
The preg_* functions are 99% of the time faster and more efficient than the ereg* functions.
--
Jason k Larson
qt wrote:
It is not working toif (eregi("/\b(got|am)\b", $mesage, $matches))