From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Fri, 11 Jan 2013 16:16:30 +0100 Message-ID: From: Rudolf Sykora To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Subject: Re: [9fans] How to do this with [acme | sam | sed ] ? Topicbox-Message-UUID: 068cfc8a-ead8-11e9-9d60-3106f5b1d025 On 11 January 2013 15:24, erik quanstrom wrote: >> # remove outermost pair of braces: abcd(x+(y-z))efgh --> abcdx+(y-z)efgh >> [ no idea :-( ] > > this is made simple since * is "greedy": > > Edit s:\((.*)\):\1:g > Sure, this (the greediness) basically already stands behind the solution of N. Bercher above (though it was unnecessarily complicated). The problem with such solutions is that you must always ensure there is just one 'expression' that you want to be edited in the dot. Being so, the 'clicking' solution proposed by B. Fabian might be easier (but it depends). General solution (which would handle multiple expressions at once), I think, is beyond simple regexps. Ruda