From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: <138575260906260250hca23acbi34aed21566004bad@mail.gmail.com> Date: Sat, 27 Jun 2009 14:17:55 -0400 Message-ID: <3aaafc130906271117h333de206xd746efe8474e6f35@mail.gmail.com> From: "J.R. Mauro" To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [9fans] Sam commands in acme Topicbox-Message-UUID: 0fc8db6e-ead5-11e9-9d60-3106f5b1d025 On Fri, Jun 26, 2009 at 6:57 AM, roger peppe wrote: > you need (.|\n) instead of . > > sam originally used @ as a "match everything" character > but it was removed, presumably because it was rarely used. That's a stupid reason to remove a good feature. By that token, maybe we should remove structural regular expressions since they're "rarely used" and just go back to using ed. Do you know if anyone preserved this feature and could send me the patch? > > to match C comments, you need something like this: > > x/\/\*([^*]|\*[^\/]|[^*\/]|\n)*\*\// > > 2009/6/26 hugo rivera : >> Hi, >> I am trying to select all c comments from within a file using acme, >> but I am unable to do it properly. The command x/\/\*.*\*\// is the >> closest I could get, but it doesn't work with comments that span over >> more than one line. This raises a question for me: somewhere, I cannot >> recall where, I read that commands in sam (and therefore acme) aren't >> line oriented but selection oriented, so, shouldn't '.*' match newline >> characters also? why it doesn't? I expected '.*' to work with newline >> characters since it works for spaces and tabs, and the three of them >> are white space, among others. >> And finally, what command I should use to select c comments without >> regard if they are several lines long or just one? >> Saludos >> -- >> Hugo >> >> > >