Re: preg functions & phplib templates

From: Date: Tue, 04 Jul 2000 00:38:51 +0000
Subject: Re: preg functions & phplib templates
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-4620@lists.php.net to get a copy of this message
In article <637C00F0303AD311BCCC009027887A7C420D46@tiger.wild.net>, Chris.Boget@wild.net ("Boget, Chris") wrote: > I'm looking into using the PHPLib templates, but I see > that they use the preg() functions. Now, we are using > PHP 3.0.5 (my boss will not upgrade due to the downtime Just how long does he intend to stay at 3.0.5?... Is there a development box where you can test 3.0.16 or whatever was the latest 3.0? If not, there's something fundamentally wrong with your boss' setup... > it would require; we are running alot of e-commerce sites > and the downtime would cost money) and I see that the > preg() functions were not added until 3.0.9. > I know I can change the preg_replace() functions to > ereg_replace() (yes, I know ereg_replace() is a bit slower), > but I'm not sure what I can change the preg_quote() and > the preg_match_all() functions to. Are there any comparable > functions to either of the above that are available in 3.0.5? > Or has anyone written any comparable functions in PHP? Some of the behaviour of preg_ is quite *different* from ereg_, not just faster. In fact, the faster part is more of a bonus, not the original intent of the developer of PREG. Greedy versus non-greedy expressions, in particular, is going to bite you in the butt and not be easily fixed, if at all. And the functions you note probably just don't have a reasonable work-around in ereg_, I would guess... The time and money you'll waste doing a preg_ to ereg_ conversion will be far, far more than buying a development box, loading it up with all the sites, upgrading to 3.0.newest or even PHP4, and start fixing it. Don't take this wrong, but maybe it's time you start looking for a new job :-) -- Richard Lynch | If this was worth $$$ to you, buy a CD US Customer Support Director | from one of the artists listed here: Zend Technologies USA | http://www.L-I-E.com/artists.htm http://www.zend.com | (this has nothing to do with Zend, duh!)

« previous php.general (#4620) next »