I have a question about converting text links to hyper links. I did it successfully by using this code from this link; How to replace plain URLs with links?
function replaceURLWithHTMLLinks(text) {
var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
return text.replace(exp,"<a href='$1'>$1</a>");
}
The output of this code is like;
Input: http://www.tinymoviez.com Output: <a href='http://www.tinymoviez.com'>http://www.tinymoviez.com</a>
Now what i want is to get anchor text not in link form, it should be without 'http://www.'
In short i need the output as
<a href='http://www.tinymoviez.com'>tinymoviez.com</a>
But keep in mind that it should be auto, i will convert bulk of links at a time.
How can i do that??? Any help will be appreciated.