Re: which regexp require preg_grep() and which can be used with ereg()?
| From: | CC Zona | Date: | Wed, 10 Oct 2001 20:22:16 +0000 |
| Subject: | Re: which regexp require preg_grep() and which can be used with ereg()? | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-70731@lists.php.net to get a copy of this message | ||
In article <20011010134314.96005.qmail@pb1.pair.com>,
jazrant@zsc.nrcan.zc.ca (John A. Grant) wrote:
> > I still don't understand why you would bother looking for an ereg
> > equivalent when you can just use "/\S/" as-is with a preg_*, but
> <shrug>...
> I dunno. I guess I figured that I should learn the non-Perl
> way, since I'm in the PHP world now. I always try to adapt
> to a new language when I'm learning it, instead of holding
> on to conventions and usage from other languages. But
> I guess it's fine to use preg_*
LOL. Now I get it. Yeah, there isn't really a "PHP way" (POSIX extended
regular expressions not being limited to PHP), but PHP does offer Perl
users the opportunity to do regex the "Perl(-like) way". So yeah it's fine
to take advantage of that opportunity.
preg_* is there, it's fast, it's flexible, it's powerful--go for it.
Cheers!
--
CC