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

Re: regexp



On Thu, 18 Jan 2007 (16:29), Lucio Crusca wrote:
> $ cat file.txt | grep 'a\{0,3\}'
> aaa
> aaaaa
> Perché mi trova anche la seconda riga? Non dovrebbe trovarmi solo la prima?

Eh, no... Anche nella seconda c'è un numero di 'a' compreso tra 0 e 3.
Che ce ne siano anche di più a lui non interessa.

grep '^a\{0,3\}$'

Ciao,
-- 
Daniele                 JID: dan@jabber.linux.it (http://www.jabber.org)
and remember: respect is everything . . . . . . . . . . . free your mind

Attachment: signature.asc
Description: Digital signature


Reply to: