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

Re: Serie di lettere e numeri da combinare - come??



venerdì 30 aprile 2004, alle 20:15, Johan Haggi scrive:


> > E perché? Da 'a' a 'z' ci sono solo lettere minuscole, a prescindere dalla
> > locale. Va coi codici ASCII. O c'è qualcosa delle regexp che mi sfugge?
> 
> Prova con un locale it_IT a dare il comando:
> ls -d /[A-Z]*
> 
> se leggi la man di grep trovi il perche` cercando la stringa LC_ALL

Ah, ottimo, era una cosa che avevo notato molto tempo fa e che ora non
ricordavo. Grazie :)

(BTW, ho scoperto che la manpage italiana di grep manca proprio di *quel*
paragrafo... LOL! Se ho tempo, riporto il baco)

Ma nella stessa manpage si legge anche:

For example, [[:alnum:]] means  [0-9A-Za-z],  except  the  latter  form
depends upon the C locale and the ASCII character encoding, whereas the
former is independent of locale and  character  set.   (Note  that  the
brackets  in these class names are part of the symbolic names, and must
be included in addition to the brackets delimiting the  bracket  list.)

[...]

The period .  matches any single character.  The symbol \w is a synonym
for [[:alnum:]] and \W is a synonym for [^[:alnum]].
	      
Quindi, mi pare di capire che [[:alnum:]] potrebbe essere una soluzione più
elegante rispetto allo scrivere tutti i caratteri... o non ho capito nulla
io, di nuovo?

Gabriele :-)

P.S.: sono iscritto alla lista, non c'è bisogno di rispondere anche a me,
grazie :-)

-- 
http://www-studenti.dm.unipi.it/~stilli/ mailto:superenzima@libero.it
ICQ UIN: 159169930                 [HT] Lothlorien F.C. (51042, V.54)
Caccole Stellari Website:             http://www.caccolestellari.com/
Gruppo Utenti Linux Pisa:                   http://www.gulp.linux.it/

Attachment: signature.asc
Description: Digital signature


Reply to: