Re: regexp matching- real simple!

2003-11-13 Thread Tore Aursand
On Thu, 13 Nov 2003 18:15:40 -0500, Nandita Mullapudi wrote: > I want my script to carry out a loop only if the number stored in > $diff is positive, > so i say > if ($diff =~m/^[-\d+]/) {blah blah} > but it won't work. why? That's pretty irrelevant in your case; You're using a cannon to get rid

Re: regexp matching- real simple!

2003-11-13 Thread Brian Gerard
And the clouds parted, and Jeff 'japhy' Pinyan said... > > Well, your regex is matching either a digit, a -, or a + as the first > character in $diff. If you wanted to match a POSITIVE number, you'd be > better with /^+?\d/, but WHY are you using a regex for a MATH problem? > > if ($diff > 0)

Re: regexp matching- real simple!

2003-11-13 Thread Brian Gerard
And the clouds parted, and Nandita Mullapudi said... > > This has to be really easy- but I cant get it to work: > I want my script to carry out a loop only if the number stored in > $diff is positive, > so i say > if ($diff =~m/^[-\d+]/) {blah blah} > but it won't work. why? > TIA > -Nandita Hi N

Re: regexp matching- real simple!

2003-11-13 Thread Jeff 'japhy' Pinyan
On Nov 13, Nandita Mullapudi said: >This has to be really easy- but I cant get it to work: >I want my script to carry out a loop only if the number stored in >$diff is positive, >so i say >if ($diff =~m/^[-\d+]/) {blah blah} >but it won't work. why? Well, your regex is matching either a digit, a

RE: regexp matching- real simple!-GOT IT!

2003-11-13 Thread Nandita Mullapudi
Thanks, -Nandita -Original Message- From: Nandita Mullapudi [mailto:[EMAIL PROTECTED] Sent: Thursday, November 13, 2003 5:16 PM To: [EMAIL PROTECTED] Subject: regexp matching- real simple! This has to be really easy- but I cant get it to work: I want my script to carry out a loop only if

Re: regexp matching- real simple!

2003-11-13 Thread Kevin Old
On Thu, 2003-11-13 at 18:15, Nandita Mullapudi wrote: > This has to be really easy- but I cant get it to work: > I want my script to carry out a loop only if the number stored in > $diff is positive, > so i say > if ($diff =~m/^[-\d+]/) {blah blah} > but it won't work. why? > TIA > -Nandita Try t

regexp matching- real simple!

2003-11-13 Thread Nandita Mullapudi
This has to be really easy- but I cant get it to work: I want my script to carry out a loop only if the number stored in $diff is positive, so i say if ($diff =~m/^[-\d+]/) {blah blah} but it won't work. why? TIA -Nandita -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mai