From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from highwire.stanford.edu ([171.64.249.40]) by hawkwind.utcs.toronto.edu with SMTP id <25205>; Mon, 27 Mar 2000 00:24:43 -0500 Received: from aubrey.stanford.edu (jimr@aubrey.Stanford.EDU [171.64.31.58]) by highwire.stanford.edu (8.9.3/HIGHWIRE2.0) with ESMTP id RAA22703; Sat, 25 Mar 2000 17:51:46 -0800 (PST) Message-Id: <200003260151.RAA22703@highwire.stanford.edu> X-url: http://highwire.stanford.edu/~jimr/ X-face: "!ZH^<"U,NeU:732A To: "kim kubik" cc: "sam Fans" Dcc: Subject: Re: the obvious. =) In-reply-to: Message from "kim kubik" of "Sat, 25 Mar 2000 15:47:54 PST."References: <01bf96b4$8a262aa0$7dc9efd1@pkwksj.sjna.corp.dom> <01bf96b4$8a262aa0$7dc9efd1@pkwksj.sjna.corp.dom> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3671.954035506.1@aubrey.stanford.edu> Date: Sat, 25 Mar 2000 20:51:46 -0500 Sender: jimr@aubrey.stanford.edu > >,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