From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from plan9.cs.bell-labs.com ([204.178.31.2]) by hawkwind.utcs.toronto.edu with SMTP id <25324>; Mon, 27 Mar 2000 15:22:20 -0500 From: "rob pike" Subject: Re: the obvious. =) Date: Mon, 27 Mar 2000 09:37:26 -0500 To: sam-fans@hawkwind.utcs.toronto.edu MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <00Mar27.152220est.25324@hawkwind.utcs.toronto.edu> ,x/^\/\*(.+\n)+ \*\/\n/ t /}\n/ Regular expressions have their limitations, which is why Sam also has addresses. These provide a simpler and safer way to match multi-line things like comments: ,x/^\/\*/ .,/\*\/\n/ t /}\n/ This one works even if there are no blank lines. Here's a troff paragraph-at-a-time pattern: ,x/^\.PP/ .,/^\.(PP|SH)/- ... Also if there's a slash in the pattern, you can use another character as the delimiter and save a backslash, as in this example for C++ // comments: x/\/\// goes to x;//; Have fun. -rob