I am working with this Java Script and am trying to figure out how to include the hyphen all the way to the end of the link.
Here is the sample link: http://www.mydomain.com:5678/cgi-bin/encoder?USER=admin&PWD=123456&VIDEO_RESOLUTION=N1280x720
And here is the code ((http://jsfiddle.net/moe3615/G9A86/)
// Check the main container is ready
$('#feed').ready(function(){
// Get each div
$('.content').each(function(){
// Get the content
var str = $(this).html();
// Set the regex string
var regex = /(https?:\/\/([-\w\.]+)+(:\d+)?(\/([\w\/_\.]*(\?\S+)?)?)?)/ig
// Replace plain text links by hyperlinks
var replaced_text = str.replace(regex, "<a href='$1' target='_blank'>$1</a>");
// Echo link
$(this).html(replaced_text);
});
});
Any help would be greatly appreciated