Il giorno Fri, 16 Mar 2007 15:44:54 +0100
Ola Lundqvist <[EMAIL PROTECTED]> ha scritto:
> > As for my ( very personal ) thought I'd use 
> > 
> > [[:alnum:]]*(*([[:alnum:]-])[[:alnum:]])
> 
> Agree in principle.
> 
> > ( note the lacking of dash and the case insensitive match )
> 
> Why the lack of dash?

Because it isn't a valid character as for some DNS-related RFC.
However, on second thought, I'm now remembering the homograph attack and
so IDN and what that implies about allowed characters. While the above
regex covers the majority of cases, it surely doesn't allow legitimate
hostnames. Maybe letting the user be on his own about the choice of the
hostname is the safest way, unless you also want to deal with IDNA.

> I think your suggestion above is fully ok, but I think I have to allow
> dash, at least for backwards compatibility.

Good point.

Ciao,
Gian Piero.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to