Skip to content

Instantly share code, notes, and snippets.

@xwmx
Created July 28, 2010 02:42
Show Gist options
  • Save xwmx/493210 to your computer and use it in GitHub Desktop.
Save xwmx/493210 to your computer and use it in GitHub Desktop.
# http://daringfireball.net/2010/07/improved_regex_for_matching_urls
(?i)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment