Skip to content

Instantly share code, notes, and snippets.

@dsottimano
Created July 26, 2020 01:47
Show Gist options
  • Save dsottimano/52060e6a43d96804f33c59366c472305 to your computer and use it in GitHub Desktop.
Save dsottimano/52060e6a43d96804f33c59366c472305 to your computer and use it in GitHub Desktop.
console.log([...new Set(new URL('https://www.amazon.com/SanDisk-128GB-microSDXC-Memory-Adapter/dp/B073JYC4XM/memory').pathname.toLowerCase().split(/-|\//gi).filter(Boolean))])
//output handles dupes for casing and removes falsy values
//[ 'sandisk','128gb','microsdxc','memory','adapter','dp','b073jyc4xm' ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment