Skip to content

Instantly share code, notes, and snippets.

@DavidWells
Created May 15, 2019 22:08
Show Gist options
  • Save DavidWells/49dc2f77e2ed1ee7ac7b892be32c6822 to your computer and use it in GitHub Desktop.
Save DavidWells/49dc2f77e2ed1ee7ac7b892be32c6822 to your computer and use it in GitHub Desktop.
Parse url with Regex from https://regex101.com/r/vK4rV7/1
const reg = /(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g
const url = 'http://video.google.co.uk:80/videoplay?docid=-7246927612831078230&hl=en#hello'
reg.exec(url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment