Skip to content

Instantly share code, notes, and snippets.

@kindlyfire
Created May 25, 2015 11:12
Show Gist options
  • Save kindlyfire/7d44d329ba93581b3d6b to your computer and use it in GitHub Desktop.
Save kindlyfire/7d44d329ba93581b3d6b to your computer and use it in GitHub Desktop.
Little python link regex <3
match = re.match(ur'(?i)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?\xab\xbb\u201c\u201d\u2018\u2019]))', value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment