From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Suvayu Ali Newsgroups: gmane.emacs.help Subject: Re: Question about string-match and match-string Date: Wed, 17 Jul 2013 10:35:11 +0200 Message-ID: <20130717083511.GC16899@kuru.dyndns-at-home.com> References: <20130717081704.GB16899@kuru.dyndns-at-home.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1374050136 20804 80.91.229.3 (17 Jul 2013 08:35:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Jul 2013 08:35:36 +0000 (UTC) To: Emacs help Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 17 10:35:37 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 1UzNCz-0003Ch-63 for geh-help-gnu-emacs@m.gmane.org; Wed, 17 Jul 2013 10:35:37 +0200 Original-Received: from localhost ([::1]:46945 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzNCy-0005HC-Pq for geh-help-gnu-emacs@m.gmane.org; Wed, 17 Jul 2013 04:35:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39891) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzNCh-0005CD-B6 for help-gnu-emacs@gnu.org; Wed, 17 Jul 2013 04:35:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UzNCe-0001CZ-8B for help-gnu-emacs@gnu.org; Wed, 17 Jul 2013 04:35:19 -0400 Original-Received: from mail-wg0-x233.google.com ([2a00:1450:400c:c00::233]:42025) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzNCe-0001B3-1e for help-gnu-emacs@gnu.org; Wed, 17 Jul 2013 04:35:16 -0400 Original-Received: by mail-wg0-f51.google.com with SMTP id e11so1460243wgh.18 for ; Wed, 17 Jul 2013 01:35:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=m+PnKogOTaRFdTwhvx5gyHlyWWpDtMBepTjdQjfivEg=; b=AWA5sX5MWzkXuVB5JRuSu/9RdQGpd1tc11Jk3qikh8uwmkFyMVaDp6zPesxUuQ98Yl HZIwqOXAEupS6hDVb1p3CunLcjLdHQ3q5YUEZVb4nzfrbUUvGJM1AA6jy07fhSwSKtkn 8cFseJkp2HIaANmz5Y4lnsyCDWmKvklr5yNw222ltFra8IQI5uumI/PPGFBXzJLgVQuz T2QuUSKAMT+4jX2PUgL+sTxExAHysNTOU1hTquvx9OjlXH3oiSWJbRGyJ2dH7zzoDV3b jwnB/v3k23oQ1o2akuieCIzCQb/sUkwVScaXKzi5q4VKaZxHeZ4TmnwN8vZ3mutmFxmV Wq5w== X-Received: by 10.180.109.9 with SMTP id ho9mr1139086wib.43.1374050115330; Wed, 17 Jul 2013 01:35:15 -0700 (PDT) Original-Received: from kuru.dyndns-at-home.com (sd44012d5.adsl.online.nl. [212.64.18.213]) by mx.google.com with ESMTPSA id fb9sm33334127wid.2.2013.07.17.01.35.13 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 17 Jul 2013 01:35:14 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20130717081704.GB16899@kuru.dyndns-at-home.com> User-Agent: Mutt/1.5.21 (2012-12-30) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::233 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:92196 Archived-At: On Wed, Jul 17, 2013 at 10:17:04AM +0200, Suvayu Ali wrote: > > Debugger entered--Lisp error: (args-out-of-range -1 -1) > replace-match("" t nil "{" 1) I forgot to mention, the string above, "{", keeps changing with every subsequent evaluation! I tried to extract the sub-expressions with match-string with no luck. I get nil! (let ((test "\\section{Heading{ignoreheading}}\nText\n")) (string-match "\\(\\\\\\\\section{.+{ignoreheading}}\\\\n\\)\\(.+\\)" test) (match-string 1 test) ) nil Thanks, -- Suvayu Open source is the future. It sets us free.