Re: Prop: make URL's clickable



Ok, now for some regex magic:

((ht|f)tps?://[^][:blank:]>\r\n]+[^]>\\)( \r\n)]+)

Catches all of the cases you suggest (although you may be able to improve
upon this bad boy).

(http://www.linux.org)
<http://www.balsa.net>
[http://www.slashdot.org]
http://foo.bar.some)host/
(http://foo.bar.some)host/)
(http://www.freshmeat.net)       (many spaces)      


julian



On Sun, 13 May 2001 11:35:29 Carlos Morgado wrote:
> On Sun, May 13, 2001 at 11:37:54AM -0700, Julian M Catchen wrote:
> > Ok, sorry for the double post.  I should have looked at this longer
> before
> > posting.  I would now like to suggest this as the regex:
> > 
> > ((ht|f)tps?://[^][:blank:]\\)>\r\n]+)
> > 
> > Try clicking on these URLs to see the mangled URLs:
> > 
> > (http://www.linux.org)
> > <http://www.balsa.net>
> > [http://www.slashdot.org]
> > 
> > All of them work properly with the above suggested regex.
> > 
> 
> They also work with zvt dingus-clikin, but your regex breaks
> http://host/foo)bar.html which is legal (although rare i supose :))
> a proper regex would need ancorage and look-back/ahead no ?
> 
> -- 
> Carlos Morgado - chbm(at)chbm(dot)nu - http://chbm.nu/ -- gpgkey:
> 0x1FC57F0A 
> http://wwwkeys.pgp.net/ FP:0A27 35D3 C448 3641 0573 6876 2A37 4BB2 1FC5
> 7F0A
> (This is a shareware sig. If you wish to receive the FULL COMERCIAL
> EDITION
> please send me lots of money)
> 
> _______________________________________________
> balsa-list mailing list
> balsa-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/balsa-list
> 
> 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]