Re: Help with eregi
| From: | Curt Zirzow | Date: | Wed, 23 Jun 2004 02:19:39 +0000 |
| Subject: | Re: Help with eregi | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-188840@lists.php.net to get a copy of this message | ||
* Thus wrote Tom Z. Meinlschmidt:
> On Tue, Jun 22, 2004 at 10:08:37PM +0300 Robin Vickery [robinv@gmail.com] wrote:
> > On Tue, 22 Jun 2004 14:57:28 -0400, Ryan Schefke <ryan@triomfgroup.com> wrote:
> > >
> > > Could someone please help me with an eregi statement.
> > >
> > > I have a string that can vary as such:
> > >
> > > client1/album/album_121-2132_IMG.JPG
> > >
> > > ...
> > >
> > > I want to select whatever comes after the last forward slash, like
> > > album_121-2132_IMG.JPG
> >
> >
> > preg_match('#client[[:digit:]]+/album/(album_[[:digit:]]{3}-[[:digit:]]{4}_IMG\.JPG)#i',
> > $string, $matches);
>
> too complex.
>
> eregi("\/([a-z0-9_-]*\.jpg)$", $string, $arg) is good enough :)
Still too complex.
basename('client1/album/album_121-2132_IMG.JPG');
Curt
--
Feels like he's filling Mr Holmes shoes right now :)