Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@gene1wood
Last active December 15, 2015 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gene1wood/5296590 to your computer and use it in GitHub Desktop.
Save gene1wood/5296590 to your computer and use it in GitHub Desktop.
Extract the hostname from a url in Ruby
"https://www.example.com/"[/https?:\/\/([^\/]*)/, 1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment