Created
March 1, 2011 01:14
-
-
Save mxcl/848410 to your computer and use it in GitHub Desktop.
C-string version of John Gruber’s URL Regex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define TDURLRegularExpression "(?i)\\b((?:https?://|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?\u00AB\u00BB\u201C\u201D\u2018\u2019]))" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Mainly you want this for the unicode characters at the end which most C compilers will barf over if you just copy and paste from the original source.