Re: [PHP] Reg Ex



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.
.



Relevant Pages

  • Upgrading to 60 question.
    ... <ACPI PCI bus> on pcib0 ... <Parallel port bus> on ppc0 ... libmcrypt-2.5.7_1 Multi-cipher cryptographic library (used in PHP) ... p5-XML-Parser-2.34_1 Perl extension interface to James Clark's XML parser, ...
    (freebsd-questions)
  • Re: openssl extension not loading (need to open https stream)
    ... you configured PHP?" ... I have also enabled the openssl extension and made sure it is ... in the extension folder. ... the apache module ...
    (comp.lang.php)
  • Re: extension PHP Qt
    ... Very few people will be using PHP 5 soon. ... >>extension unless they pay the commercial Qt license. ... What I am trying to tell you is that because of the license fee payment ... Either GTK, Qt and wxWindows can work either on Linux and Windows, so ...
    (comp.lang.php)
  • Re: Making one HTML page from more than one file
    ... You don't need to worry about browser support for any particular ... odd compiler extension -- if you write code that uses the odd compiler ... Better yet would be to learn PHP, which really is a full-blown programming ...
    (alt.html)
  • Re: Making one HTML page from more than one file
    ... You don't need to worry about browser support for any particular ... odd compiler extension -- if you write code that uses the odd compiler ...
    (alt.html)