Skip to content

Instantly share code, notes, and snippets.

@konnnn
Forked from DavidWells/match-url-regex.js
Created November 15, 2019 19:49
Show Gist options
  • Save konnnn/6dcec55aafd481bd97e38c6d504c4c35 to your computer and use it in GitHub Desktop.
Save konnnn/6dcec55aafd481bd97e38c6d504c4c35 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