
Kanji
User
/ Moderator
Jul 5, 2000, 4:37 PM
Post #2 of 3
(7362 views)
|
Re: delete to end of string (beginner Q)
[In reply to]
|
Can't Post
|
|
<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> $url = 'http://www.perlarchive.com/tlc/index.shtml'; $url =~ s<^http://www\.(.*?)\.com/.*><$1>;</pre><HR></BLOCKQUOTE> ...does what you asked for. However, there are many, many URLs that such a substitution would be useless for such as http://www.perl.org/, http://perlguru.com/, http://216.71.167.148/, or something really wacky like http://http://www.to/ (and, yes, those all really do work). Consider yourself warned!
|