9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Rudolf Sykora <rudolf.sykora@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] How to do this with [acme | sam | sed ] ?
Date: Fri, 11 Jan 2013 16:16:30 +0100	[thread overview]
Message-ID: <CAOEdRO3i77C0OKkk3aMwV8nm05N7CeerWTgxwdPzAxiPcN_3bg@mail.gmail.com> (raw)
In-Reply-To: <b628c3fe860d2900eaac0867c4f50f91@brasstown.quanstro.net>

On 11 January 2013 15:24, erik quanstrom <quanstro@quanstro.net> 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



  reply	other threads:[~2013-01-11 15:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-11 11:19 Peter A. Cejchan
2013-01-11 11:44 ` Rudolf Sykora
2013-01-11 12:24   ` Peter A. Cejchan
2013-01-11 12:27     ` dexen deVries
2013-01-11 12:38       ` Bence Fábián
2013-01-11 14:24   ` erik quanstrom
2013-01-11 15:16     ` Rudolf Sykora [this message]
2013-01-11 11:46 ` Bence Fábián
2013-01-11 12:07   ` Peter A. Cejchan
2013-01-11 12:09 ` Nicolas Bercher
2013-01-11 13:10   ` Peter A. Cejchan
2013-01-11 13:24     ` Nicolas Bercher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOEdRO3i77C0OKkk3aMwV8nm05N7CeerWTgxwdPzAxiPcN_3bg@mail.gmail.com \
    --to=rudolf.sykora@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).