Re: test a password string for correctness

2001-12-20 Thread Philip Newton
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

Re: test a password string for correctness

2001-12-20 Thread Bart Lateur
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

Re: test a password string for correctness

2001-12-20 Thread Ronald J Kimball
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.

Re: test a password string for correctness

2001-12-20 Thread Philip Newton
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

Re: test a password string for correctness

2001-12-20 Thread Philip Newton
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

Re: test a password string for correctness

2001-12-20 Thread Philip Newton
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

Re: test a password string for correctness

2001-12-17 Thread abigail
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

Re: test a password string for correctness

2001-12-14 Thread Piers Cawley
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

Re: test a password string for correctness

2001-12-13 Thread Jeff 'japhy' Pinyan
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

Re: test a password string for correctness

2001-12-13 Thread Ryan Fischer
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

Re: test a password string for correctness

2001-12-13 Thread Bill Jones
> ... 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

Re: test a password string for correctness

2001-12-13 Thread Uri Guttman
> "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

Re: test a password string for correctness

2001-12-13 Thread Ronald J Kimball
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

Re: test a password string for correctness

2001-12-13 Thread Jeff 'japhy' Pinyan
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

Re: test a password string for correctness

2001-12-13 Thread Jeff 'japhy' Pinyan
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

Re: test a password string for correctness

2001-12-13 Thread Jeremy Zawodny
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

Re: test a password string for correctness

2001-12-13 Thread Ryan Fischer
> 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

Re: test a password string for correctness

2001-12-13 Thread Jeff 'japhy' Pinyan
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

Re: test a password string for correctness

2001-12-13 Thread Ryan Fischer
> 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

Re: test a password string for correctness

2001-12-13 Thread Jeff 'japhy' Pinyan
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

Re: test a password string for correctness

2001-12-13 Thread Uri Guttman
> "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

Re: test a password string for correctness

2001-12-13 Thread Ryan Fischer
> > "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

Re: test a password string for correctness

2001-12-13 Thread John W. Krahn
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

Re: test a password string for correctness

2001-12-13 Thread Uri Guttman
> "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

Re: test a password string for correctness

2001-12-13 Thread Uri Guttman
> "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

Re: test a password string for correctness

2001-12-13 Thread Ryan Fischer
> 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

Re: test a password string for correctness

2001-12-13 Thread Ryan Fischer
> 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

Re: test a password string for correctness

2001-12-13 Thread Ryan Fischer
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

[OT]RE: test a password string for correctness

2001-12-13 Thread Josh Schulz
>-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

Re: test a password string for correctness

2001-12-13 Thread Bill Jones
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

RE: test a password string for correctness

2001-12-13 Thread Richard_Cox
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

Re: test a password string for correctness

2001-12-13 Thread Ronald J Kimball
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-

Re: test a password string for correctness

2001-12-13 Thread Jeff 'japhy' Pinyan
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/

Re: test a password string for correctness

2001-12-13 Thread Jeff 'japhy' Pinyan
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

Re: test a password string for correctness

2001-12-13 Thread Rafael Garcia-Suarez
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

Re: test a password string for correctness

2001-12-13 Thread Lian Sebe
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

RE: test a password string for correctness

2001-12-13 Thread Bernie Cosell
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

RE: test a password string for correctness

2001-12-13 Thread Ala Qumsieh
> 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

Re: test a password string for correctness

2001-12-13 Thread Kim Schulz
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)

RE: test a password string for correctness

2001-12-13 Thread Patrick Gaskill
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

RE: test a password string for correctness

2001-12-13 Thread Patrick Gaskill
] > 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

Re: test a password string for correctness

2001-12-13 Thread Ariel Scolnicov
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,

Re: test a password string for correctness

2001-12-13 Thread Ronald J Kimball
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

Re: test a password string for correctness

2001-12-13 Thread Ronald J Kimball
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

Re: test a password string for correctness

2001-12-13 Thread Mohit Agarwal
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

RE: test a password string for correctness

2001-12-13 Thread Richard_Cox
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

Re: test a password string for correctness

2001-12-13 Thread Sven Neuhaus
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 $

Re: test a password string for correctness

2001-12-13 Thread Philippe 'BooK' Bruhat
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

Re: test a password string for correctness

2001-12-13 Thread Ariel Scolnicov
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

Re: test a password string for correctness

2001-12-13 Thread Mohit Agarwal
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

Re: test a password string for correctness

2001-12-13 Thread Kim Schulz
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

Re: test a password string for correctness

2001-12-13 Thread Robin Houston
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)

Re: test a password string for correctness

2001-12-13 Thread Rafael Garcia-Suarez
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

Re: test a password string for correctness

2001-12-13 Thread Sven Neuhaus
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) > >

Re: test a password string for correctness

2001-12-13 Thread Kim Schulz
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

Re: test a password string for correctness

2001-12-13 Thread Bart Lateur
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

test a password string for correctness

2001-12-13 Thread Kim Schulz
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