On Dec 13, Mohit Agarwal said:
>On Thu, Dec 13, 2001 at 03:24:14PM +0100, Sven Neuhaus wrote:
>> It won't - I was confusing it with the behavior of some tr programs.
>> So it's
>> y/A-Za-z//>2&&y/0-9//>1
>
>As some say, a space is still a byte. Looks like this one can't be made
>any shorter. Japhy, Eugene, Santa et al.??
I'm sorry I'm late. I haven't been able to get to my server for the past
several hours.
I'd have started with:
/(?=.*[a-z].*[a-z].*[a-z]).*\d.*\d/i
and migrated to:
/(?=(.*[a-z]){3}).*\d.*\d/i
(don't bother with the (.*\d){2} -- it's longer).
I probably would have thought about y/// after a while, but I can't pass
up a good regex. ;)
y/a-zA-Z//>2&&y/0-9//>1
is probably where I'd get to. I think RJK's attempt to cheat the system
fails:
y/a-zA-Z//&y/0-9//>1
fails for 4 and 3 (0100 & 0011 == 0).
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for? <tenderpuss> why, yansliterate of course.