/ Published in: JavaScript
Expand |
Embed | Plain Text
str.replace(/((http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi, '<a href="$1">$1</a>');
You need to login to post a comment.
tomsyweb on 10/09/10
3 people have marked this snippet as a favorite
sharathreddyp
grandulgoliat
bobbym245
str.replace(/((http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi, '<a href="$1">$1</a>');
You need to login to post a comment.