Subject: Re: the obvious. =)

From: "James A. Robinson" <[email-masked]>
Date: Sat, 25 Mar 2000 20:51:46 -0500

> >,x/^\/\*(.+\n)+ \*\/\n/ t /}\n/
>
> this just ran up against my (mis)understanding of 
> sam's regexp's. I'm sure when first using sam I did
> something similar to your example above and the
> 'greedy' little bastard (.+\n)+ would (to my way
> of thinking) eat the whole file, that is, never see
> the closing */ of the commment because the .+ should
> just keep on going.

Here's what I *think* is going on, but I'm no regex guru...  A '(.*\n)+'
would keep it going to the end of the file. With '(.+\n)+' I'm specifying
that there must be at least one character before the newline. So this
match ends at the first blank line.  I think the engine then backtracks
until it finds a match for ' \*\/' -- which is the end of the comment. I
believe the previous match of a newline ensures that it will not hit the
comments within the blocks (as those are '\n\t *').

And yes, I do space indent my comments so the '*' lines up with the
topmost one.  I thought that was in my post, though I did tab-indent
the whole block. Perhaps my mailer munged it.

Jim

---

From: "kim kubik" <[email-masked]>
Date: Sat, 25 Mar 2000 18:47:54 -0500

-----Original Message-----
From: James A. Robinson <[email-masked]>
To: sam Fans <[email-masked]>
Date: Friday, March 24, 2000 10:26 PM
Subject: the obvious. =)

>I just have to shout to the world (well, to sam fans) that this editor
>is wonderful>I'm finally ready I can just write
>
>To copy the top comment down to the second method. e.g.
>

Jim (or anyone): 

But I tried what you have and it works, so obviously
all this time the way I've been getting around this,
using addresses, e.g.

,x/re/{
.,/re2/do stuff
}

isn't necessary.

So what am I missing?

- kim

PS: in your example there's a space after the 
    second + that shouldn't be there, right?
    At least by your example, but probably you
    do comments as:

/*
 * so there really is a space
 * before the last splat.
 *
 */

And the example left this out.