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

abbuonandoti
ABCabc
abcde
abche
ABDADCA
Abdalla
Abdallah
abdbullah
ABDCA
Abdera
abdicasse
Abdul
Abdulaziz
Abdullah
abdurmi
Abeba
Abelardo
Abele

should become:

abcde
abche
ABDCA
Abdul
Abeba
Abele

uhmmm...



alladr

But even then it won't work.  Think about the regular expression you
have written.  It says "match the start of the string, followed by one
to five word characters".  Can you see why that would match a string
such as "terminate" for example?

Thanks all,

alladr


|^|_|^|_|^|                              |^|_|^|_|^|    
 |            |                                 |            |
 |            |                                 |            |
 |            |*\_/*\_/*\_/*\_/*\_/* |            |
 |                                                           |
 |                                                           |
 |                                                           |
 |         http://www.e-allora.net        |
 |                                                           |
 |                                                           |
**************************************

Hmmm.

--
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net



|^|_|^|_|^|                              |^|_|^|_|^|    
 |            |                                 |            |
 |            |                                 |            |
 |            |*\_/*\_/*\_/*\_/*\_/* |            |
 |                                                           |
 |                                                           |
 |                                                           |
 |         http://www.e-allora.net        |
 |                                                           |
 |                                                           |
**************************************


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to