Re: [PHP] Reg Ex
- From: eric.butera@xxxxxxxxx ("Eric Butera")
- Date: Fri, 31 Oct 2008 08:44:32 -0400
On Fri, Oct 31, 2008 at 8:41 AM, Kyle Terry <kyle@xxxxxxxxxxxxx> wrote:
I thought of a couple other ways anyway...
basename($file, '.zip')
substr($file, 0, -4)
On Fri, Oct 31, 2008 at 5:33 AM, Stut <stuttle@xxxxxxxxx> wrote:
On 31 Oct 2008, at 12:27, Kyle Terry wrote:
I'm horrible with regular expression. I need to match the text before a
file
extension. So if the file is called US.123.kyle.20081029.zip, I would then
need to match US.123.kyle.20081029.
No regex required. Why do people think everything like this needs a regex??
http://php.net/pathinfo
-Stut
--
http://stut.net/
--
Kyle Terry | www.kyleterry.com
Who says every file will have an extension? Who says they're all .+3
chars? When I first started php I tried that and it failed in a lot
of places.
.
- Follow-Ups:
- Re: [PHP] Reg Ex
- From: "Daniel P. Brown"
- Re: [PHP] Reg Ex
- From: Warren Windvogel
- Re: [PHP] Reg Ex
- References:
- Reg Ex
- From: "Kyle Terry"
- Re: [PHP] Reg Ex
- From: Stut
- Re: [PHP] Reg Ex
- From: "Kyle Terry"
- Reg Ex
- Prev by Date: Re: [PHP] Reg Ex
- Next by Date: Re: [PHP] Reg Ex
- Previous by thread: Re: [PHP] Reg Ex
- Next by thread: Re: [PHP] Reg Ex
- Index(es):
Relevant Pages
|