Skip to content

Instantly share code, notes, and snippets.



Created Feb 18, 2018
What would you like to do?
Find and count multiple words on a website
(function (x) {
var text = document.body.textContent;
return (v) {
var m = text.match(new RegExp("\\s(" + v + ")[\\s.,!?]", "gi"));
return m ? m.length : 0;
})(["add", "all", "your", "words", "here"]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.