次の text/html を取得しました。
Hello ! You should check this link : http://google.com
And this link too : <a href="http://example.com">http://example2.com</a>
正規表現でテキスト内の URL をキャッチして、それらを<a>
. 次の正規表現を取得しました:
var REG_EXP = /[^">]((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)[^"<]/gi;
しかし、私の正規表現もキャッチhttp://example.com
し、http://example2.com
. そして、これを回避するためにそれを改良する方法がわかりません。