Re: finding a blank line

2003-10-16 Thread Hacksaw
>If you think that's clearer then that's fine. You don't? More importantly, you think that would be clear to the next maintainer down the line? >build a bitmap for character classes and access it by character code. That >would make all character classes equally as fast. Very good point. >it's

Re: finding a blank line

2003-10-16 Thread Rob Dixon
"Hacksaw" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Hacksaw wrote: > > > > > > > I know this is a no brainer, but this line of code does not always work: > > > > last if( /^\n/ or /^\s+\n/ ); > > > > > > Why not > > > > > > last if /^\s*$/; > > > > > > You don't need the () i

Re: finding a blank line

2003-10-15 Thread Hacksaw
> Hacksaw wrote: > > > > > I know this is a no brainer, but this line of code does not always work: > > > last if( /^\n/ or /^\s+\n/ ); > > > > Why not > > > > last if /^\s*$/; > > > > You don't need the () in this version of the construction. > > That's logically identical to > > last unless /

Re: finding a blank line

2003-10-15 Thread Rob Dixon
Hacksaw wrote: > > > I know this is a no brainer, but this line of code does not always work: > > last if( /^\n/ or /^\s+\n/ ); > > Why not > > last if /^\s*$/; > > You don't need the () in this version of the construction. That's logically identical to last unless /\S/; Rob -- To unsubsc

Re: finding a blank line

2003-10-15 Thread Hacksaw
> I know this is a no brainer, but this line of code does not always work: > last if( /^\n/ or /^\s+\n/ ); Why not last if /^\s*$/; You don't need the () in this version of the construction. '*' matches zero or more of the preceding RE. -- The future is what the present can bear. http://www.ha

Re: finding a blank line

2003-10-15 Thread Tore Aursand
On Wed, 15 Oct 2003 02:24:25 -0500, Jerry Preston wrote: > I know this is a no brainer, but this line of code does not always work: > last if( /^\n/ or /^\s+\n/ ); Can't you check the length of the line? last unless ( length ); This will work if the line really _is_ blank. However, humans ten

Re: finding a blank line

2003-10-15 Thread ramprasad
Jerry Preston wrote: Hi! I know this is a no brainer, but this line of code does not always work: last if( /^\n/ or /^\s+\n/ ); What am I missing? Is there a better way? Thanks, Jerry Are you trying to match a multiline string then do a /^\s*$/m Bye Ram -- To unsubscribe, e-mail: [EMAIL PR

Re: finding a blank line

2003-10-15 Thread Rob Dixon
Jerry Preston wrote: > > I know this is a no brainer, but this line of code does not always work: > > last if( /^\n/ or /^\s+\n/ ); > > What am I missing? Is there a better way? In general it would be last unless /\S/; but I can't see why what you've written wouldn't work. Rob -- To unsu

Re: finding a blank line

2003-10-15 Thread Sudarshan Raghavan
Jerry Preston wrote: > Hi! > > I know this is a no brainer, but this line of code does not always work: > > last if( /^\n/ or /^\s+\n/ ); last if (/^\s*$/); Out of curiosity, can you post the cases for which your statement did not work? Are these strings with embedded newlines? > > > What am I

finding a blank line

2003-10-15 Thread Jerry Preston
Hi! I know this is a no brainer, but this line of code does not always work: last if( /^\n/ or /^\s+\n/ ); What am I missing? Is there a better way? Thanks, Jerry -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]