Skip to content

Instantly share code, notes, and snippets.

@leotada
Last active December 18, 2019 19:24
Show Gist options
  • Select an option

  • Save leotada/08059bc5fc886deed9ec17c918489ca2 to your computer and use it in GitHub Desktop.

Select an option

Save leotada/08059bc5fc886deed9ec17c918489ca2 to your computer and use it in GitHub Desktop.
Regex to get domain in a url - link
domain
([\w-]+\.)+(\w+)
link to another page
href="(.+?)"
link to another page excluding extensions
href="(.+(?:(?<!css|js|jpg|jpeg|gif|tiff|png|bmp|svg|ico)))"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment