正規表現で画像を取得しようvar testData = 'url入り文字列'; matches = testData.match(/http[s]?\:\/\/[\w\+\$\;\?\.\%\,\!\#\~\*\/\:\@\&\\\=\_\-]+/g); var res = new Array; $.each(matches, function() { if(this != ''){ if(this.match(/.jpg|.png|.gif|.jpeg/)){ res.push(this); } } }); alert(res);