Skip to content

Instantly share code, notes, and snippets.

@oboenikui
Created March 9, 2016 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oboenikui/4dfead6f12cf2f90949f to your computer and use it in GitHub Desktop.
Save oboenikui/4dfead6f12cf2f90949f to your computer and use it in GitHub Desktop.
Wikipediaのアニメ一覧のページで正規表現に一致したアニメの名前を返す
/**
* Wikipediaの日本のアニメ一覧のページ(こことか http://bit.ly/1U437EE)で正規表現にマッチしたアニメタイトルを返す
*/
function animeMatcher(regexp) {
var animes = [];
$(".wikitable > tbody > tr > td:nth-child(2)").each(function(){
if(this.innerText.match(regexp)){
animes.push(this.innerText);
}
});
return animes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment