help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about string-match and match-string


From: Suvayu Ali
Subject: Re: Question about string-match and match-string
Date: Wed, 17 Jul 2013 10:35:11 +0200
User-agent: Mutt/1.5.21 (2012-12-30)

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]