Created
March 9, 2016 21:22
-
-
Save oboenikui/4dfead6f12cf2f90949f to your computer and use it in GitHub Desktop.
Wikipediaのアニメ一覧のページで正規表現に一致したアニメの名前を返す
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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