11/09/25 12:22:45.27
作ってやったぞ、カス。
var isMatched = function(url, ary) {
for (var i = 0, len = ary.length, part, next = 0; i < len; i++) {
part = ary[i];
next = url.indexOf(part, next);
if (next < 0) return false;
next += part.length;
}
return true;
},
func = (function(list) {
return function(url) {
for (var i = 0, len = list.length, ary; i < len; i++) {
if (isMatched(url, list[i].split(/\*/))) return true;
}
return false;
};
})(['URLリンク(*google.*)', 'URLリンク(*yahoo.co.jp)']);
var url = "URLリンク(google.mizutama.lemon.co.jp)";
alert(func(url));