From: Angus Comber <anguscomber@gmail.com>
To: tomas@tuxteam.de
Cc: Emacs Help <help-gnu-emacs@gnu.org>
Subject: Re: How to insert a string every 2 characters
Date: Sat, 22 Aug 2015 15:58:05 +0100 [thread overview]
Message-ID: <CAAtGUhVJXmqmskQM9mU=Jt1kGygyTYKeoTUYZoJwkk8PNFk6jg@mail.gmail.com> (raw)
In-Reply-To: <20150822144544.GA27850@tuxteam.de>
That didn't work quite how I wanted. It just replaces 2 characters with a
space. But I I did like this:
c-m-% \(..\)
and replace with \1
with a space after \1 that works.
On 22 August 2015 at 15:45, <tomas@tuxteam.de> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Sat, Aug 22, 2015 at 02:37:39PM +0100, Angus Comber wrote:
> > Hi
> >
> > If I have a string of characters like this:
> >
> > 0102030405
> >
> > I want to transform into:
> >
> > 01 02 03 04 05
> >
> > How do I do that?
>
> The short answer: query-replace-regexp RET .. RET ..<SPACE>
> (substitute the <SPACE> there by a real space, of course).
>
> The long answer: do you have many strings like that? Just
> one? How long are they? Do you have to do that very often?
>
> regards
> - -- tomás
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.12 (GNU/Linux)
>
> iEYEARECAAYFAlXYixgACgkQBcgs9XrR2kYEFgCfaH9b0KrzKLtzhmnbZdFCcOcT
> cwUAn2IoQB2aFnp9EfA1YAdCMri57sED
> =npOb
> -----END PGP SIGNATURE-----
>
next prev parent reply other threads:[~2015-08-22 14:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-22 13:37 How to insert a string every 2 characters Angus Comber
2015-08-22 14:45 ` tomas
2015-08-22 14:58 ` Angus Comber [this message]
2015-08-22 17:03 ` tomas
2015-08-23 21:48 ` Emanuel Berg
2015-08-23 21:43 ` Emanuel Berg
2015-08-24 15:12 ` Nicolas Richard
2015-08-24 20:09 ` Emanuel Berg
2015-08-25 9:16 ` Nicolas Richard
2015-08-25 20:39 ` Emanuel Berg
2015-08-26 10:55 ` Nicolas Richard
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='CAAtGUhVJXmqmskQM9mU=Jt1kGygyTYKeoTUYZoJwkk8PNFk6jg@mail.gmail.com' \
--to=anguscomber@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=tomas@tuxteam.de \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.