Skip to content

Instantly share code, notes, and snippets.

@willread
Created May 16, 2013 17:49
Show Gist options
  • Save willread/5593619 to your computer and use it in GitHub Desktop.
Save willread/5593619 to your computer and use it in GitHub Desktop.
Make URLs in a string clickable.
"string http://domain.tld/path with a URL".replace(/(http[s]?:\/\/)([^\s]+)/, "<a href='$1$2'>$2</a>")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment