HTML:
<textarea name="test">
http://google.com/
https://google.com/
http://www.google.com
www.google.com/
[url=http://google.com/]test[/url]
text
</textarea>
jQuery:
$('button').click(function() {
if ($('textarea[name="test"]').val().match(/\[url/)) {
alert('links exist');
}
});
自分の中にあるすべてのURLインスタンスに一致する正規表現の種類は何<textarea>
ですか?
jsFiddle: http: //jsfiddle.net/5Z8AU/