Re: match file name at end of a http url
- From: nishanth_ev@xxxxxxxxx (Nishanth Ev)
- Date: Tue, 25 Apr 2006 20:49:26 -0700 (PDT)
Hello,
I tried this and worked.
Please let me know in case you find any bugs in this
:)
$url="http://dev.catalyst.perl.org/wiki/YetAnotherCatalystIntro";
if( $url =~ /\/([\w.]*$)/ ){
print $1;
}
else{
print "No Match";
}
Regards
Nishanth
--- Tom Phoenix <tom@xxxxxxxxxxxxxx> wrote:
On 4/25/06, John Ackley <john@xxxxxxxxxx> wrote:
if( $url =~ /\/(.*$)/ )
then characters after last / are found in $1
Unfortunately, characters after the first slash are
in there, too.
To process a URL requires more than a simple pattern
match. Use a
module from CPAN. Cheers!
--Tom Phoenix
Stonehenge Perl Training
--
To unsubscribe, e-mail:
beginners-unsubscribe@xxxxxxxx
For additional commands, e-mail:
beginners-help@xxxxxxxx
<http://learn.perl.org/>
<http://learn.perl.org/first-response>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
.
- Follow-Ups:
- Re: match file name at end of a http url
- From: Tom Phoenix
- Re: match file name at end of a http url
- References:
- Re: match file name at end of a http url
- From: Tom Phoenix
- Re: match file name at end of a http url
- Prev by Date: Re: match file name at end of a http url
- Next by Date: Re: match file name at end of a http url
- Previous by thread: Re: match file name at end of a http url
- Next by thread: Re: match file name at end of a http url
- Index(es):
Relevant Pages
|