Hi

On Fri, Mar 16, 2007 at 02:38:15PM +0100, Gian Piero Carrubba wrote:
> Il giorno Thu, 15 Mar 2007 07:38:46 +0100
> Ola Lundqvist <[EMAIL PROTECTED]> ha scritto:
> 
> > > 
> > > That should be 
> > > [[:lower:][:digit:]]*(*([[:lower:][:digit:]_-])[[:lower:][:digit:]]))
> > 
> > But this regex still allow -a, right?
> 
> Mmh, no... well, it doesn't here :).

Oh, good! I really thought that it would match that.

> > > Please use [:class:] instead of [a-z] as the latter is locale
> > > dependant and, while it seems reverted on recent bash, i think i
> > > can remember that a not-so-old release of bash broke it down
> > > ( well, the bash is/was right, the scripts aren't ).
> > 
> > Hmm, well I'm not sure if I want to allow other letters than that.
> 
> Not sure I'm following you here.
> [[:lower:]] is the same that [a-z], but better :):
> 
> [EMAIL PROTECTED]:~/test$ touch a A b B y Y z Z
> [EMAIL PROTECTED]:~/test$ echo $LC_COLLATE
> C
> [EMAIL PROTECTED]:~/test$ ls [a-z]
> a  b  y  z
> [EMAIL PROTECTED]:~/test$ ls [[:lower:]]
> a  b  y  z
> [EMAIL PROTECTED]:~/test$ export LC_COLLATE="[EMAIL PROTECTED]"
> [EMAIL PROTECTED]:~/test$ ls [a-z]
> a  A  b  B  y  Y  z
> [EMAIL PROTECTED]:~/test$ ls [[:lower:]]
> a  b  y  z
> 
> 
> As said, it seems that now ( at least etch - bash 3.1dfsg-8 ) the
> "case .. in" match follows the COLLATE=C behaviour, but anyway
> [:class:] should be a safer choice.
> 
> > Do posix allow other letters?
> 
> Tried to quickly dig into SUSv3 w/o finding any reference to it
> ( please note that "I haven't found" != "there's none" ). Anyway IMHO
> trying to melt down POSIX, DNS, RFC, conventions and various
> implementations is really a pain and I'm not sure the OP was kidding
> when said you, as the coder, have to take your decision ( i assume you
> already did, i.e., when allowed only lower characters ).

ehm... Well I should allow upper case letters as well... :)

> 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?

> that IMHO should be a valid rfc hostname ( apart from not enforcing an
> upper lenght limit ), as the 2-characters lower limit isn't so clearly
> affirmed ( think about the DN root servers ).

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

Regards,

// Ola

> 
> Ciao,
> Gian Piero.
> 

-- 
 --- Ola Lundqvist systemkonsult --- M Sc in IT Engineering ----
/  [EMAIL PROTECTED]                   Annebergsslingan 37        \
|  [EMAIL PROTECTED]                   654 65 KARLSTAD            |
|  http://opalsys.net/               Mobile: +46 (0)70-332 1551 |
\  gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9  /
 ---------------------------------------------------------------


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

Reply via email to