From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sean McAfee Newsgroups: gmane.emacs.help Subject: Re: Another replace regexp with list question Date: Tue, 11 Jun 2013 11:23:44 -0700 Organization: A noiseless patient Spider Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1370975813 17331 80.91.229.3 (11 Jun 2013 18:36:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Jun 2013 18:36:53 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jun 11 20:36:54 2013 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 1UmTR8-0004FI-0D for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Jun 2013 20:36:54 +0200 Original-Received: from localhost ([::1]:37942 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmTR7-0002ci-Kx for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Jun 2013 14:36:53 -0400 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 11 Injection-Info: mx05.eternal-september.org; posting-host="9602142ff40e0c8bd8027a6f5e009406"; logging-data="29061"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19CVYPZSAZr/gL6r/6pBvbRUXyhn+SdYUI=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) Cancel-Lock: sha1:/zJOnzq0HhcFAU6N8wtCddiD9/U= sha1:LPP205ZgnyeMgmwHuREMMiBHGZ0= Original-Xref: usenet.stanford.edu gnu.emacs.help:199198 X-Mailman-Approved-At: Tue, 11 Jun 2013 14:36:35 -0400 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:91462 Archived-At: Leandro Marcolino writes: > This time I am trying to find occurrences of: > > "私私私私", but > the number of 私 can change from 1 to many. > > And I want to replace each 私 of the list to a white space (besides > removing the clause). So, if there were x "私", I need x " ". Replace: \(\)\(\(?:私\)+\)\(\) With: \1\,(make-string (/ (length \2) 8) ? )\3