Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: How do I replace a URL with a clickable hyperlink?

by tachyon (Chancellor)
on Feb 14, 2002 at 14:45 UTC ( [id://145453]=note: print w/replies, xml ) Need Help??


in reply to How do I replace a URL with a clickable hyperlink?

$text = <<TEXT; Hello World http://www.world.com/index.htm http://foo.com http://bar.com TEXT ($links = $text) =~ s!(http://[^\s]+)!<a href="$1">$1</a>!gi; print $text,"\n\n",$links;

Replies are listed 'Best First'.
Re: Answer: How do I replace a URL with a clickable hyperlink?
by merlyn (Sage) on Feb 14, 2002 at 16:12 UTC
    This is wrong, of course, for unusual links that contain HTML-nasty characters, unless you presume that the input contains no quotes and is already HTML-safe.

    -- Randal L. Schwartz, Perl hacker

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://145453]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-03-19 07:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found