You need to avoid delimiters ("/") using backslashes. Separators mark the beginning and end of an expression. You can use a slash only when you escape it with a backslash. The following expression should work:
var reg=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?ยซยป""โโ]))/;
source
share