Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Parse keywords from URL
let url = "";
let kwparse = (url.replace('https://','').replace('http://','').replace('www','').replace('com','').split('-').join().split('/').join().split('.')).join(',').replace(/^,/, '')
let kwuniq = [ Set(kwparse.split(','))].filter(function(e){return e});
// ["amazon", "SanDisk", "128GB", "microSDXC", "Memory", "Adapter", "dp", "B073JYC4XM"]
// Hat Tip - Find a cleaner version at
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment