Hyperlink Regex

var text = "https://loco.com/page1?asdf=wre&sfsd=sdf";
var reg:RegExp=/(b(https?|ftp|file)://[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|])/ig;
trace(text.replace(reg,"<a href="$&">$&</a>"));

0 Comments

You must be logged in to post a comment.