Your skill will accomplish what the force of many cannot |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
This is the regex I use to recognize URLs in plain text:
The negative look-ahead takes care that in http://example.com/something, the comma isn't treated as part of the URL (it is a valid part of the URL, but usually you don't want to include it nevertheless). For adding the trailing / and extracting the host name you need a bit more logic, for which I'm too lazy right now to write. I think that Regexp::Common has an option to capture the domain name somehow, but I haven't investigated in that either. I hope this is of interest nonetheless. In reply to Re: Linkifying URLs in plain text
by moritz
|
|