From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Angus Comber Newsgroups: gmane.emacs.help Subject: Re: How to insert a string every 2 characters Date: Sat, 22 Aug 2015 15:58:05 +0100 Message-ID: References: <20150822144544.GA27850@tuxteam.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1440255503 24569 80.91.229.3 (22 Aug 2015 14:58:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 22 Aug 2015 14:58:23 +0000 (UTC) Cc: Emacs Help To: tomas@tuxteam.de Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Aug 22 16:58:22 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZTAFP-0004Vl-RT for geh-help-gnu-emacs@m.gmane.org; Sat, 22 Aug 2015 16:58:20 +0200 Original-Received: from localhost ([::1]:46838 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTAFP-0007xb-5A for geh-help-gnu-emacs@m.gmane.org; Sat, 22 Aug 2015 10:58:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTAFD-0007wy-9A for help-gnu-emacs@gnu.org; Sat, 22 Aug 2015 10:58:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZTAFC-0000kP-Ah for help-gnu-emacs@gnu.org; Sat, 22 Aug 2015 10:58:07 -0400 Original-Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]:34829) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTAFC-0000k6-3n for help-gnu-emacs@gnu.org; Sat, 22 Aug 2015 10:58:06 -0400 Original-Received: by wicne3 with SMTP id ne3so36805415wic.0 for ; Sat, 22 Aug 2015 07:58:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=uZEin3YRXmIdpMS29m0i0quhU01CYhJP5rGhm/v3cD0=; b=TRzkWv9+UGnfJc8yhmN2zxNBJ6U1pw60W3Whm/gY59Uva7wLh/23QVGNpSz54dBd3J BJsD4GBv2fzhOo7cSjesjjzmkTKygoTxu97rdEKaHJY0vf35hcAu34yX+6JiRqhPaWCT 3DWmkLFtd0uGqqb10b8BoMLcrc8iPJtCoWAsRPQX2E5FiDM9v3H3Gx3I2D59cY+XjwGk qjF34yVLnBRfAbwB6i1dzmWq5UOPdnJg0emtwRkAA2yYjPEf2JT8uvEyKwfDUI8jvwlA vNyBoEzaQeRlya3yqJzuTnZ3IG/CvwndkqKyQG7AXoN1FRK4O7JMvC3h4yzJIAIZiDs4 +CgA== X-Received: by 10.180.19.65 with SMTP id c1mr15190647wie.15.1440255485435; Sat, 22 Aug 2015 07:58:05 -0700 (PDT) Original-Received: by 10.28.170.17 with HTTP; Sat, 22 Aug 2015 07:58:05 -0700 (PDT) In-Reply-To: <20150822144544.GA27850@tuxteam.de> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::235 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:106771 Archived-At: 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, 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 .. > (substitute the 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=C3=A1s > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.12 (GNU/Linux) > > iEYEARECAAYFAlXYixgACgkQBcgs9XrR2kYEFgCfaH9b0KrzKLtzhmnbZdFCcOcT > cwUAn2IoQB2aFnp9EfA1YAdCMri57sED > =3DnpOb > -----END PGP SIGNATURE----- >