Re: Trivial newbie regex question

From: Date: Thu, 14 Nov 2002 04:44:41 +0000
Subject: Re: Trivial newbie regex question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-124379@lists.php.net to get a copy of this message
Maybe also check out http://www.php.net/parse_url and http://www.php.net/pathinfo Justin French on 14/11/02 1:33 PM, Jonathan Sharp (js-lists@sharpmedia.net) wrote: > try > basename('http://www.domain.com/stuff/index.html'); > > -js > > > Charles Wiltgen wrote: >> Hello, >> >> I just want to get the "index" part of >> "http://www.domain.com/stuff/ >> index.html". >> >> I'm trying to figure out this regex stuff, but it hasn't yet clicked. >> Here's my best guess: >> >> ereg('?/(*)\.html$', $source, $dest); >> >> To me -- and please be gentle -- this means, "Starting with the forward >> slash closest to the end of $source, capture whatever comes after it and >> before '.html', and put it in $dest." Obviously not correct, but I've >> spent >> an embarrassing amount of time feel stupid. Help? >> >> -- Charles Wiltgen >> >> > > > Justin French -------------------- Creative Director http://Indent.com.au Web Developent & Graphic Design --------------------

« previous php.general (#124379) next »