Re: hot to use perg_match with multi strign patern
| From: | qt | Date: | Sat, 10 May 2003 20:34:12 +0000 |
| Subject: | Re: hot to use perg_match with multi strign patern | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-147104@lists.php.net to get a copy of this message | ||
Dear jason,
Is there any punctuation which is telling such as this:
for yes : ye*
I want to match some first parth of the words and rest can be anything.
"Jason K Larson" <jlarson@candlefire.org> wrote in message
news:3EB8EB38.40402@candlefire.org...
> 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 to
> >
> >
> >>>if (eregi("/\b(got|am)\b", $mesage, $matches))
>