Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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

( #274001=categorized answer: print w/ replies, xml ) Need Help??

Q&A > regular expressions > How do I replace a URL with a clickable hyperlink? - Answer contributed by Abigail-II

If you are interested in matching valid HTTP URI's, you could use Regexp::Common:
use Regexp::Common; $text =~ s[($RE{URI}{HTTP})] [<a href = "$1">$1</a>]g;

Abigail

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2016-08-27 05:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (377 votes). Check out past polls.