Skip to content

Instantly share code, notes, and snippets.

@wnghdcjfe
Created January 10, 2017 03:46
Show Gist options
  • Save wnghdcjfe/4e7bacabc549b1afb9ecda445dc3260d to your computer and use it in GitHub Desktop.
Save wnghdcjfe/4e7bacabc549b1afb9ecda445dc3260d to your computer and use it in GitHub Desktop.
angular js filter img tag
.filter('findImg', function(){
return function(item){
//?은 바로 앞의 문자가 있거나 없거나를 판단
//예를 들자면 홍철?영주 >> 영주 또는 홍철영주를 반환한다.
var reg1 = item.match(/src=\"(.+?)\"/i);
//var reg1 = item.match(/src=[\"](.+?)[\"].*?/i);
var reg2 = reg1[0].split('"');
return reg2[1];
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment