On 20 Dec 01, at 13:05, Ronald J Kimball wrote:
> On Thu, Dec 20, 2001 at 07:00:30PM +0100, Philip Newton wrote:
> > On Thu, 13 Dec 2001 10:50:11 -0500, [EMAIL PROTECTED]
> > (Ronald J Kimball) wrote:
> >
> > > (y/a-zA-Z// > 2) & (y/0-9// > 1)
> > >
> > > Each numeric comparison will return eit
On Thu, 20 Dec 2001 19:00:30 +0100, Philip Newton wrote:
>On Thu, 13 Dec 2001 10:50:11 -0500, [EMAIL PROTECTED]
>(Ronald J Kimball) wrote:
>
>> (y/a-zA-Z// > 2) & (y/0-9// > 1)
>>
>> Each numeric comparison will return either 1 or 0.
>
>In my experience, 1 or "", rather than 1 or 0. Or is FALSE
On Thu, Dec 20, 2001 at 07:00:30PM +0100, Philip Newton wrote:
> On Thu, 13 Dec 2001 10:50:11 -0500, [EMAIL PROTECTED]
> (Ronald J Kimball) wrote:
>
> > (y/a-zA-Z// > 2) & (y/0-9// > 1)
> >
> > Each numeric comparison will return either 1 or 0.
>
> In my experience, 1 or "", rather than 1 or 0.
On Thu, 13 Dec 2001 10:50:11 -0500, [EMAIL PROTECTED]
(Ronald J Kimball) wrote:
> (y/a-zA-Z// > 2) & (y/0-9// > 1)
>
> Each numeric comparison will return either 1 or 0.
In my experience, 1 or "", rather than 1 or 0. Or is FALSE (PL_NO?) a
special value which looks like 0 to operators that care
On Thu, 13 Dec 2001 19:25:02 -0500 (EST), [EMAIL PROTECTED] (Jeff 'Japhy'
Pinyan) wrote:
> I'd probably include capitalized operators in the obscure group
Which capitalised operators? NE, LT, and friends?
I think they went away in bleadperl... didn't they?
Cheers,
Philip
On Thu, 13 Dec 2001 18:10:26 -0500, [EMAIL PROTECTED] (Ryan Fischer)
wrote:
> This should do it I think:
>
> /[a-zA-Z]/==3&&/[0-9]/==2&&/^.{5,}$/;
Pattern match in scalar context returns true or false, so the maximum
number is 1. You'll never get 3 out of a pattern match in scalar context
(and
On Thu, Dec 13, 2001 at 03:24:14PM +0100, Sven Neuhaus wrote:
> On Thu, Dec 13, 2001 at 03:01:43PM +, Mohit Agarwal wrote:
> > On Thu, Dec 13, 2001 at 02:49:05PM +0100, Sven Neuhaus wrote:
> > > y/A-Za-z/A-Za-z/>2&&y/0-9/0-9/>1
> > > or the shorter
> > > $a=$_;y/A-Za-z//>2&&y/0
Jeremy Zawodny <[EMAIL PROTECTED]> writes:
> On Thu, Dec 13, 2001 at 07:00:19PM -0500, Jeff 'japhy' Pinyan wrote:
>> On Dec 13, Ryan Fischer said:
>>
>> And it's not an obscure use NOR an abuse of the function. The fact that
>> tr/a-z// replaces the empty replacement list with a-z is SPECIFICAL
On Dec 13, Uri Guttman said:
>if i ever saw someone getting a string length in real code with tr/// i
>would kick them hard. on the other hand counting the number of newlines
>in a string is a valid use of that effect. in fact there is no other
>simple and fast way to count newlines in a string b
You wrote:
> On Thu, Dec 13, 2001 at 07:11:09PM -0500, Ryan Fischer wrote:
> > I guess it simply wasn't good that the guy asked a question on an
FWP
> > list where TMTOWTDI and so many people think the short ways are
better.
> > If he was simply looking for an answer, any other list would have
wor
> ... The problem is when people value that over getting the job
> done, and try to make people feel inferior with their "knowledge."
>
Greetings :)
I disagree. Growth in the direction of effectiveness in Perl
dictates learning to read code - especially when Perl has the bad
tag of a "Wri
> "JZ" == Jeremy Zawodny <[EMAIL PROTECTED]> writes:
JZ> The fact that it is documented doesn't change that fact that it's
JZ> obscure. (I wish more people understood that.) I suspect that
JZ> many of the folks who frequent this list have been wearing their
JZ> Perl blinders long en
On Thu, Dec 13, 2001 at 07:11:09PM -0500, Ryan Fischer wrote:
> I guess it simply wasn't good that the guy asked a question on an FWP
> list where TMTOWTDI and so many people think the short ways are better.
> If he was simply looking for an answer, any other list would have worked
> fine.
I gues
On Dec 13, Jeff 'japhy' Pinyan said:
>On Dec 13, Jeremy Zawodny said:
>
>>Think back to when you were first learning Perl. Or regular
>>expressions. They're documented but you still find yourself thinking
>>"damn, this is obscure..." Are you wrong?
>
>New experiences often seem obscure. I don
On Dec 13, Jeremy Zawodny said:
>Think back to when you were first learning Perl. Or regular
>expressions. They're documented but you still find yourself thinking
>"damn, this is obscure..." Are you wrong?
New experiences often seem obscure. I don't think a person LEARNING the
language can s
On Thu, Dec 13, 2001 at 07:00:19PM -0500, Jeff 'japhy' Pinyan wrote:
> On Dec 13, Ryan Fischer said:
>
> And it's not an obscure use NOR an abuse of the function. The fact that
> tr/a-z// replaces the empty replacement list with a-z is SPECIFICALLY
> documented, and the use of this for counting
> On Dec 13, Ryan Fischer said:
>
> >> i wouldn't call them counter intuitive as they are clearly
documented
> >> and make it more flexible than your single use approach would.
> >
> >To each his own. Not everyone has the time to dink around and pat
each
> >other on the back at obscure usages and
On Dec 13, Ryan Fischer said:
>> i wouldn't call them counter intuitive as they are clearly documented
>> and make it more flexible than your single use approach would.
>
>To each his own. Not everyone has the time to dink around and pat each
>other on the back at obscure usages and abuses of fu
> rtfm.
Hehe... I read it years ago. But how kind of you to flame me. You must
feel so good about yourself. ;)
> i wouldn't call them counter intuitive as they are clearly documented
> and make it more flexible than your single use approach would.
To each his own. Not everyone has the time
On Dec 13, Ryan Fischer said:
>Bleh. You learn something new every day. But, if anything, I'd say
>that's a glaring bug and not a feature. translations are supposed to
>replace one character with another. If no character is specified, the
>most intuitive thing to happen is an omission. What
> "RF" == Ryan Fischer <[EMAIL PROTECTED]> writes:
RF> Bleh. You learn something new every day. But, if anything, I'd say
RF> that's a glaring bug and not a feature. translations are supposed to
RF> replace one character with another. If no character is specified, the
RF> most int
> > "RF" == Ryan Fischer <[EMAIL PROTECTED]> writes:
>
> >> y/a-zA-Z//>2&&y/0-9//>1
>
> RF> That's not gonna do it. You'll kill $_. :(
>
> you don't know y/// too well if you think that. it is a well known
perl
> golf trick.
>
> uri
Bleh. You learn something new every day. But, if any
Ryan Fischer wrote:
>
> You wrote:
> > How short kan you make a program (oneliner?) that:
> >
> > * checks if a password is 5 characters long or more
> > * checks if the password contains at least 3 alpha chars (a-zA-Z)
> > * checks if the password contains at least 2 numbers (0-9)
> >
> > I need
> "RF" == Ryan Fischer <[EMAIL PROTECTED]> writes:
>> On Thu, Dec 13, 2001 at 02:29:14PM +0100, Kim Schulz wrote:
>> > How short kan you make a program (oneliner?) that:
>> >
>> > * checks if a password is 5 characters long or more
>> > * checks if the password contains at least 3 a
> "RF" == Ryan Fischer <[EMAIL PROTECTED]> writes:
>> y/a-zA-Z//>2&&y/0-9//>1
RF> That's not gonna do it. You'll kill $_. :(
you don't know y/// too well if you think that. it is a well known perl
golf trick.
uri
--
Uri Guttman -- [EMAIL PROTECTED] http://www.stemsy
> On Thu, Dec 13, 2001 at 02:29:14PM +0100, Kim Schulz wrote:
> > How short kan you make a program (oneliner?) that:
> >
> > * checks if a password is 5 characters long or more
> > * checks if the password contains at least 3 alpha chars (a-zA-Z)
> > * checks if the password contains at least 2 nu
> Bart Lateur wrote :
> >
> > >How short kan you make a program (oneliner?) that:
> > >
> > >* checks if a password is 5 characters long or more
> > >* checks if the password contains at least 3 alpha chars (a-zA-Z)
> > >* checks if the password contains at least 2 numbers (0-9)
> >
> > If a passw
You wrote:
> How short kan you make a program (oneliner?) that:
>
> * checks if a password is 5 characters long or more
> * checks if the password contains at least 3 alpha chars (a-zA-Z)
> * checks if the password contains at least 2 numbers (0-9)
>
> I needed 5 lines of code how about you guys
>-Original Message-
>From: Bill Jones [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, December 13, 2001 9:22 AM
>To: Lian Sebe
>Cc: Kim Schulz; [EMAIL PROTECTED]
>Subject: Re: test a password string for correctness
>
>
>In the USA Kim is a boys name as well.
Kim S
In the USA Kim is a boys name as well. Difficult to determine
gender via e-mail - ie, 'Abigail'?
On a side note, if we all took the MAFIA test, we could say -
Isa you a girl or buoy? Or isa you a Girl, Oh Buoy!
:)
-Sx-
PS - Some woman have called me *Tammy* :]
On Thursday, December 13, 20
On 13 December 2001 14:40 Ronald J Kimball
[mailto:[EMAIL PROTECTED]] wrote:
> > if (y/a-zA-Z//>2&&y/0-9//>1) { # 24 chars for the test
> > print "not valid";
> > }
>
> That does not change $_.
>
Which explains my lack of understanding of a few previous golds...
Richard Cox
S
On Thu, Dec 13, 2001 at 10:41:57AM -0500, Jeff 'japhy' Pinyan wrote:
> 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-
On Dec 13, Jeff 'japhy' Pinyan said:
>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
My bad. He had
y/a-zA-Z//>2&y/0-9//>1
which is perfectly valid.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
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. Ja
Ariel Scolnicov wrote in fwp:
> Ronald J Kimball <[EMAIL PROTECTED]> writes:
>
> > > If you are prepared to change $_:
> > >
> > > if (y/a-zA-Z//>2&&y/0-9//>1) {# 24 chars for the test
> > > print "not valid";
> > > }
> >
> > That does not change $_.
>
> But, just to keep things
You've ruined the magic! (Next time you'll get less feedback to your
problem(s). ;-)
- Original Message -
From: "Kim Schulz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 13, 2001 5:24 PM
Subject: Re: test a password string for corr
On 13 Dec 2001, at 10:25, Ala Qumsieh wrote:
> > From: Sven Neuhaus [mailto:[EMAIL PROTECTED]]
> >
> > Too bad you can't write
> >
> > y/A-Za-z// > y/0-9// > 1
>
> Rejoice and be happy for in Perl 6 you should be able to do just that!
>
> But, this solution is still wrong because it will not
> From: Sven Neuhaus [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 13, 2001 9:24 AM
> To: [EMAIL PROTECTED]
> Subject: Re: test a password string for correctness
>
> Too bad you can't write
>
> y/A-Za-z// > y/0-9// > 1
Rejoice and be happy for in P
On Thu, 13 Dec 2001 10:12:05 -0500
Patrick Gaskill <[EMAIL PROTECTED]> wrote:
> Oh, maybe I should've finished sifting through the rest of the posts
> first... and I guess she never said that the characters would be in a
> row...*sigh*
hehe it's HE not she! In Denmark Kim is a Boys name.
:o)
10:09 AM
> To: '[EMAIL PROTECTED]'
> Subject: RE: test a password string for correctness
>
>
> Here's my attempt, at 39:
>
> #!/usr/bin/perl
> $_=pop;print if(/[a-z]{3,}/i&&/\d{2,}/)
>
> I skipped the first constraint, because if rules 2 a
]
> Sent: Thursday, December 13, 2001 8:29 AM
> To: [EMAIL PROTECTED]
> Subject: test a password string for correctness
>
>
> hi guys
>
> How short kan you make a program (oneliner?) that:
>
> * checks if a password is 5 characters long or more
> * checks if the password
Ronald J Kimball <[EMAIL PROTECTED]> writes:
> On Thu, Dec 13, 2001 at 08:36:03AM -0600, [EMAIL PROTECTED] wrote:
> > If you are prepared to change $_:
> >
> > if (y/a-zA-Z//>2&&y/0-9//>1) { # 24 chars for the test
> > print "not valid";
> > }
>
> That does not change $_.
But,
On Thu, Dec 13, 2001 at 08:36:03AM -0600, [EMAIL PROTECTED] wrote:
> If you are prepared to change $_:
>
> if (y/a-zA-Z//>2&&y/0-9//>1) {# 24 chars for the test
> print "not valid";
> }
That does not change $_.
>
> If you can't change $_, you need the c opt on the y's, he
On Thu, Dec 13, 2001 at 03:24:14PM +0100, Sven Neuhaus wrote:
> On Thu, Dec 13, 2001 at 03:01:43PM +, Mohit Agarwal wrote:
> > On Thu, Dec 13, 2001 at 02:49:05PM +0100, Sven Neuhaus wrote:
> > > y/A-Za-z/A-Za-z/>2&&y/0-9/0-9/>1
> > > or the shorter
> > > $a=$_;y/A-Za-z//>2&&y/0
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
>
> Too bad you can't write
>
> y/A-Za-z// > y/0-9// > 1
As some say, a space is still a byte. Looks like this one can't be m
On 13 December 2001 13:29, Kim Schulz [mailto:[EMAIL PROTECTED]] wrote
> How short kan you make a program (oneliner?) that:
>
> * checks if a password is 5 characters long or more
As noted, this is covered below...
> * checks if the password contains at least 3 alpha chars (a-zA-Z)
> * checks i
On Thu, Dec 13, 2001 at 03:01:43PM +, Mohit Agarwal wrote:
> On Thu, Dec 13, 2001 at 02:49:05PM +0100, Sven Neuhaus wrote:
> > y/A-Za-z/A-Za-z/>2&&y/0-9/0-9/>1
> > or the shorter
> > $a=$_;y/A-Za-z//>2&&y/0-9//>1
> > that will mungle the password in $_ but keep a good copy in $
En réponse à Ariel Scolnicov <[EMAIL PROTECTED]>:
> Robin Houston <[EMAIL PROTECTED]> writes:
>
> > It's interesting to try & do it as a single regex. The shortest
> > I've found is:
> >
> > /(?=[a-z].*[a-z].*[a-z]).*\d.*\d/
>
> /(?=(.*[a-z])){3}(.*\d){2}/i
>
> (you also need the i I gu
Robin Houston <[EMAIL PROTECTED]> writes:
> On Thu, Dec 13, 2001 at 02:29:14PM +0100, Kim Schulz wrote:
> > How short kan you make a program (oneliner?) that:
> >
> > * checks if a password is 5 characters long or more
> > * checks if the password contains at least 3 alpha chars (a-zA-Z)
> > * c
On Thu, Dec 13, 2001 at 02:49:05PM +0100, Sven Neuhaus wrote:
> > /^(?=.*\d.*\d)(?=.*[a-z].*[a-z].*[a-z])/i
>
> y/A-Za-z/A-Za-z/>2&&y/0-9/0-9/>1
> or the shorter
> $a=$_;y/A-Za-z//>2&&y/0-9//>1
> that will mungle the password in $_ but keep a good copy in $a.
Why will it mung
On Thu, 13 Dec 2001 14:43:18 +0100
[snip]
> > Short enough?
> >
>
> Not exactly..
> how about a password lige ab12345 ? it's more than 5 characters long,
> but only 2 of then are letters. This password shouldn't be accepted.
DOOH! my mistake. I didnt think this one over enough. ofcause will
On Thu, Dec 13, 2001 at 02:29:14PM +0100, Kim Schulz wrote:
> How short kan you make a program (oneliner?) that:
>
> * checks if a password is 5 characters long or more
> * checks if the password contains at least 3 alpha chars (a-zA-Z)
> * checks if the password contains at least 2 numbers (0-9)
Bart Lateur wrote :
>
> >How short kan you make a program (oneliner?) that:
> >
> >* checks if a password is 5 characters long or more
> >* checks if the password contains at least 3 alpha chars (a-zA-Z)
> >* checks if the password contains at least 2 numbers (0-9)
>
> If a password contains at
On Thu, Dec 13, 2001 at 02:36:38PM +0100, Bart Lateur wrote:
> On Thu, 13 Dec 2001 14:29:14 +0100, Kim Schulz wrote:
> >How short kan you make a program (oneliner?) that:
> >* checks if a password is 5 characters long or more
> >* checks if the password contains at least 3 alpha chars (a-zA-Z)
> >
On Thu, 13 Dec 2001 14:36:38 +0100
Bart Lateur <[EMAIL PROTECTED]> wrote:
> On Thu, 13 Dec 2001 14:29:14 +0100, Kim Schulz wrote:
>
> >How short kan you make a program (oneliner?) that:
> >
> >* checks if a password is 5 characters long or more
> >* checks if the password contains at least 3 alph
On Thu, 13 Dec 2001 14:29:14 +0100, Kim Schulz wrote:
>How short kan you make a program (oneliner?) that:
>
>* checks if a password is 5 characters long or more
>* checks if the password contains at least 3 alpha chars (a-zA-Z)
>* checks if the password contains at least 2 numbers (0-9)
If a pas
hi guys
How short kan you make a program (oneliner?) that:
* checks if a password is 5 characters long or more
* checks if the password contains at least 3 alpha chars (a-zA-Z)
* checks if the password contains at least 2 numbers (0-9)
I needed 5 lines of code how about you guys?
later..
Kim S
57 matches
Mail list logo