Reputation: 78132
There's a PCRE regex for extracting URLs posted here: http://daringfireball.net/2009/11/liberal_regex_for_matching_urls
\b(([\w-]+://?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/)))
What would need to be changed to make it compatible with regex in .NET?
Upvotes: 3
Views: 285
Reputation: 1322
Looking at in Regexbuddy now. So far, the only issue is the [:punct:] - doesn't look like .NET supports POSIX character classes.
EDIT - double clicking on the offender gave me this:
\b(([\w-]+://?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^\p{P}\s]|/)))
Upvotes: 3