var contentUE = loadEditor("contents", 1000, 300);
contentUE.addListener('selectionchange',function(){
var getAllHtml=UE.getEditor('contents').getContent();
var img_url=imgUrlFun(getAllHtml);
if(!isEmpty(img_url)){
$("#thumb_img").val(img_url);
}
})
/*判断用户输入是否为空*/
function isEmpty (str) {
if (str == null || str == "") { return true };
}
function imgUrlFun(str){
var data = '';
str.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/, function (match, capture) {
data = capture;
});
return data
}