Re: [PHP4BETA] CVS update: php4/ext/pcre

From: Date: Tue, 25 May 1999 20:33:29 +0000
Subject: Re: [PHP4BETA] CVS update: php4/ext/pcre
References: 1 2  Groups: php.version4 
Request: Send a blank email to php-version4+get-1037@lists.php.net to get a copy of this message
Andi Gutmans wrote: > > At 15:48 25/05/99 -0400, Rasmus Lerdorf wrote: > > > I think having aliases when not for backwards compatibility is a bad thing > > > to do. We should decide on one set of function names and stick to them. > > > Personally I prefer the preg over pcre. I think it'll be more intuitive > > for > > > users. > > > >I agree completely on the aliases thing. But it sort of was for backward > >compatibility purposes. > > > >We have ereg() and ereg_replace() currently. The proposal was to > >introduce: preg_match() and preg_replace() where preg_match() would be > >equivalent in functionality to ereg(). This is where I suggested we might > >want to make an alias such that preg() did the same as preg_match() to > >help the folks who would expect the preg() function to exist. I guess > >not a pure backward compatibility alias, but close. I definitely wasn't > >suggesting aliasing pcre_* to preg_* > > Hmm that's a tough one then. I do prefer *_match. I always thought the old > ereg() to be confusing. > I'm kind of undecided on the issue now. I just know I like preg more than > pcre :) And *_match() more than *(). But I'm not sure about what aliases > I'd add if any. > > Andi > --- > Andi Gutmans <andi@zend.com> > ICQ: 1568297 > > -- > PHP 4 Beta My vote is preg_match(), preg_replace(), preg_split(). These make the most sense to the eye when glancing at the code. pcre_* may not make much sense to someone who doesn't know what it means. I have a feeling that perl style regular expressions will be quite popular with PHP, and there wouldn't be much of a reason to go back to POSIX regex unless you didn't want to take the time to compile pcre into PHP4. We have done some preliminary testing and it looks as if pcre is 2-4 times faster than the built in POSIX regex with equivalent expressions. preg_replace() will also take arrays as arguments. Monte -- PHP 4 Beta

« previous php.version4 (#1037) next »