Re: Reg Ex

From: Date: Fri, 31 Oct 2008 14:57:53 +0000
Subject: Re: Reg Ex
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-282708@lists.php.net to get a copy of this message
On Fri, Oct 31, 2008 at 9:53 AM, Kyle Terry <kyle@kyleterry.com> wrote: > Thanks for the reply. For now I used substr($filename,0,-4) and that worked > perfectly. I need to learn reg ex badly :(. Before you do that, learn to read and follow along in an email thread that you start. We gave you perfect pointers as to (a) why regexp's aren't needed in this case; and (b) how to better handle it. Your substr() routine won't work as expected in all cases. Imagine either an .htaccess file or an extensionless file named quagmire. You'll come up with cess and mire, respectively. -- </Daniel P. Brown> http://www.parasane.net/ daniel.brown@parasane.net || danbrown@php.net Ask me about our current hosting/dedicated server deals!

« previous php.general (#282708) next »