Skip to content

Instantly share code, notes, and snippets.

@tomasswood
Created July 20, 2021 23:51
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 tomasswood/98314e8ced48c9a274e78a012b1962e7 to your computer and use it in GitHub Desktop.
Save tomasswood/98314e8ced48c9a274e78a012b1962e7 to your computer and use it in GitHub Desktop.
let r = /(\w{2,4}-\d+)/gm;
let t = Array.from(document.getElementsByClassName('subject')).reduce((acc, node) => {
const match = node.innerText.match(r);
if (match && match.length > 0) {
return acc.add(...match.map((m) => m.toUpperCase()))
}
return acc;
}, new Set());
console.log([...t].sort().join("\n"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment