>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
"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
> 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 /
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
> 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
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
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
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
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
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]
10 matches
Mail list logo