develooper Front page | perl.macperl.anyperl | Postings from October 2004

Filter a url

Thread Next
From:
Eelco Alosery
Date:
October 31, 2004 04:48
Subject:
Filter a url
Message ID:
1ED9F9AC-2B3B-11D9-8E97-000A957B8576@multi-graphics.nl
Hello,

I want to filter a url from $ENV{'HTTP_REFERER'}
If the url is http://www.testdomein.nl/test.html
I only want a result testdomein.nl

I have been testing whit this script
$url =~ s/.*?\.(.+?)\/.*?/$1/is;

It delets the first part of the url corect, but after .nl it deletes 
the slash and not the remaining tekst.
The result is testdomein.nltest.html

What is it i do wrong.

Thanks,
Eelco Alosery


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About