Teddy --

...and then Octavian Rasnita said...
% 
% Hi all,

Hello!


% 
% I want to check if in a string there are more than 3 capital letters.
% I've tried using:
% 
% if ($string=~ /[A-Z]{3,}/) {
...
% 
% For example, I want to match this string: "AxxxBxxxCxxx".

That's not so bad:

  [zero] [9:59pm] ~>  echo "xxAyyBzzCnn" | \
    perl -e 'while (<>) { print "GOTIT\n" if /[A-Z].*[A-Z].*[A-Z]/ }'
  GOTIT

(One of the few times you'll see me use "<action> if <condition>".)


% 
% Thank you for any tips.

HTH & HAND


% 
% Teddy,
% [EMAIL PROTECTED]


:-D "I may not know much perl but I sure know regexps" T-G
-- 
David T-G                      * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/    Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

Attachment: msg05299/pgp00000.pgp
Description: PGP signature

Reply via email to