リンク情報があればタグで囲む正規表現

// リンク情報があれば<a>タグで囲む正規表現
str = str.replace(new RegExp("((?:https?|ftp)(?::\/\/[-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+))","g"),"<u><a href=\"$1\" target='_blank'>$1</a></u>");

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">