Re: URL_REGEXP and URLs ending with ')'

Urs Janßen <[email protected]> Fri, 18 Apr 2014 19:59:24 +0200
Newsgroups gmane.network.tin.devel
Message-ID <[email protected]>
On Fri, Apr 18, 2014 at 05:31:19PM +0200, Dennis Preiser wrote:
> Wikipedia use many URLs that end with ')', e.g.
> 
> 	<http://en.wikipedia.org/wiki/Tin_(newsreader)>
> 
> Tin's regex does not recognize the ')' as part of the URL. The attached

this was intentionally to avoid capturing ) when it does not belong to
the url.

for a de.* full feed with ~14 days retention 3466 out of 88146 matches would
differ (3.93%). out of 3466 differences

242 matches of urls which also match

(\.(txt|html?|jpg|png|pdf|flv|zip|php|aspx)\)|\)[\.,:\?=]|/\))\s*$

and are very likely to be an error, and 1688 matches which also had
an opening ( in it and thus are likely to be correct.

for the remaining 1541 differences, most of them look like errors, but I
dind't check the links, i.e.

http://de.wikipedia.org/wiki/Liste_von_Katastrophen_der_Luftfahrt)
https://addons.mozilla.org/de/seamonkey/addon/bugmail/?src=api)
http://xnews.newsguy.com/xnews_de.chm)
http://www.vba-tutorial.de/cgi-bin/mailto.pl)
http://www.youtube.com/watch?v=3DMX4oUtCMoOc).=20
http://www.deutschepost.de/dpag?xmlFile=link1016009_901)
http://bit.ly/ekg72U)
https://twitter.com/zugschlusine/status/442945994121293824/photo/1)
[...]

> patch fixes this for me but I'm not sure if this is the right solution.

IMHO the closing ) at the end of the url should only be catptured if there
was an opening ( befor, otherwise it should not be trated to be part of
the url to avoid wrong captures. have fun with putting that into a regexp ,-)

urs