Possible Duplicate:
detect url's in text with Javascript
I want to check a text for the existence of links in it. want to check for http, https and/or www links. me tried this.
.replace(/(\w+):\/\/[\S]+(\b|$)/gim,'<a href="$&" class="my_link" target="_blank">$&</a>')
.replace(/([^\/])(www[\S]+(\b|$))/gim,'$1<a href="http://$2" class="my_link" target="_blank">$2</a>');
where http and https are working but www is not working. i want to get that link in variable too
please help. thanks