Re: Prop: make URL's clickable



On Sun, May 13, 2001 at 10:57:46PM +0100, Carlos Morgado wrote:
> 
> Em Dom, 13 Mai 2001 20:41:54 Julian M Catchen escreveu:
> > 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)      
> > 
> > 
> indeed it does. i must say i'm nearly incapable of reading that regex 
> without having the good book with me (many times of perlre :)) but i'll
> believe you :)
> 
> btw, http://foo.bar.some)host/ *is* invalid :)

No it's not.  Not as long as you're using DNS for your hosts: DNS
names may only include a-zA-Z0-9 and hyphens.

I think that http://foo.bar.host/file)name may be valid, though.  I'd
need to check the RFC on URI-encoding.

Jules




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