Re: selecting short words

2006-06-11 Thread Dr.Ruud
"Mr. Shawn H. Corey" schreef: > print if /\b\w{1,5}\b/; Variants: print "<$_>\n" for /\b\w{1,5}\b/g ; print "<$1>\n" while /\b(\w{1,5})\b/g ; that would split up "marsh-fever". -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional com

Re: selecting short words

2006-06-11 Thread Mr. Shawn H. Corey
On Sun, 2006-11-06 at 18:49 +0200, Adriano Allora wrote: > yes, > specifying the end of the string it's necessasy, but, if I write: > > #!/usr/bin/perl -w > > print STDOUT "Leggo...\n"; > while (<>) > { > print "$_" if /^\w{1,5}$/; > } > > the script doesn't match words (but TH

Re: selecting short words

2006-06-11 Thread Paul Johnson
On Sun, Jun 11, 2006 at 06:49:30PM +0200, Adriano Allora wrote: > yes, > specifying the end of the string it's necessasy, but, if I write: > > #!/usr/bin/perl -w > > print STDOUT "Leggo...\n"; > while (<>) > { > print "$_" if /^\w{1,5}$/; > } > > the script doesn't match words

Re: selecting short words

2006-06-11 Thread Adriano Allora
yes, specifying the end of the string it's necessasy, but, if I write: #!/usr/bin/perl -w print STDOUT "Leggo...\n"; while (<>) { print "$_" if /^\w{1,5}$/; } the script doesn't match words (but THERE ARE words of 5 or 4 characters). I cannot undestand abbuonandot

Re: selecting short words

2006-06-11 Thread Paul Johnson
On Sun, Jun 11, 2006 at 04:33:52PM +0200, Adriano Allora wrote: > i need to extract from a list of words (in a single column) anotherl > list containing only the words of 5 or less chars. > > I wrote this script, but it doesn't work: > > #!/usr/bin/perl -w > > while (<>) > { > pri

selecting short words

2006-06-11 Thread Adriano Allora
Hi to all, i need to extract from a list of words (in a single column) anotherl list containing only the words of 5 or less chars. I wrote this script, but it doesn't work: #!/usr/bin/perl -w while (<>) { print "$_" if /^\w{,5}/; } someone can tell me why it does no