all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* replacement in string
@ 2008-06-03  6:58 alruccaba
  0 siblings, 0 replies; 4+ messages in thread
From: alruccaba @ 2008-06-03  6:58 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/html, Size: 1100 bytes --]

[-- Attachment #2: Type: text/plain, Size: 618 bytes --]

Hallo everyone,
have an idea why this is it not working?:
replace-regexp-in-string "/" "\\" "a / b")
I just want to replace every "/" through an "\".
Debugger entered--Lisp error: (error "Invalid use of `\\' in replacement text")
  replace-match("\\" nil nil "/" nil)
  replace-regexp-in-string("/" "\\" "a / b")
  eval((replace-regexp-in-string "/" "\\" "a / b"))
  eval-expression((replace-regexp-in-string "/" "\\" "a / b") nil)
Greetings

Unbegrenzter Speicher, Top-Spamschutz, 120 SMS und eigene E-MailDomain inkl.
http://office.freenet.de/dienste/emailoffice/produktuebersicht/power/mail/index.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: replacement in string
       [not found] <mailman.12589.1212476938.18990.help-gnu-emacs@gnu.org>
@ 2008-06-03  7:31 ` Ralf Angeli
  0 siblings, 0 replies; 4+ messages in thread
From: Ralf Angeli @ 2008-06-03  7:31 UTC (permalink / raw)
  To: help-gnu-emacs

* alruccaba@justmail.de (2008-06-03) writes:

> have an idea why this is it not working?:
> replace-regexp-in-string "/" "\\" "a / b")
> I just want to replace every "/" through an "\".
> Debugger entered--Lisp error: (error "Invalid use of `\\' in replacement text")

You have to quote the backslash:
(replace-regexp-in-string "/" "\\\\" "a / b")

-- 
Ralf


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Re: replacement in string
@ 2008-06-03 11:53 alruccaba
  2008-06-03 12:13 ` Peter Dyballa
  0 siblings, 1 reply; 4+ messages in thread
From: alruccaba @ 2008-06-03 11:53 UTC (permalink / raw)
  To: Ralf Angeli, help-gnu-emacs

Yes, I already quoted the letter, please see below. Your quotation works but it produces an "a \ b" and not "a  b" what I intended to. I am struggeling with the commands (shell-command "command "c:/Dokumente und Einstellungen/.."")  I hope this works anyway in this case. Very Thanks.

----- original Nachricht --------

Betreff: Re: replacement in string
Gesendet: Di 03 Jun 2008 09:41:00 CEST
Von: "Ralf Angeli"<dev.null@caeruleus.net>

> * alruccaba@justmail.de (2008-06-03) writes:
> 
> > have an idea why this is it not working?:
> > replace-regexp-in-string "/" "\" "a / b")
> > I just want to replace every "/" through an "".
> > Debugger entered--Lisp error: (error "Invalid use of `\' in replacement
> text")
> 
> You have to quote the backslash:
> (replace-regexp-in-string "/" "\\" "a / b")
> 
> -- 
> Ralf
> 

--- original Nachricht Ende ----




Unbegrenzter Speicher, Top-Spamschutz, 120 SMS und eigene E-MailDomain inkl.
http://office.freenet.de/dienste/emailoffice/produktuebersicht/power/mail/index.html





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: replacement in string
  2008-06-03 11:53 Re: replacement in string alruccaba
@ 2008-06-03 12:13 ` Peter Dyballa
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Dyballa @ 2008-06-03 12:13 UTC (permalink / raw)
  To: alruccaba; +Cc: help-gnu-emacs, Ralf Angeli


Am 03.06.2008 um 13:53 schrieb alruccaba:

> Your quotation works but it produces an "a \ b" and not "a  b" what  
> I intended to.

Then use this:

	(replace-regexp-in-string "/" "" "a / b")

The slash is replaced by nothing.

--
Mit friedvollen Grüßen

   Pete

Who the fsck is "General Failure," and why is he reading my disk?






^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-06-03 12:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-03 11:53 Re: replacement in string alruccaba
2008-06-03 12:13 ` Peter Dyballa
     [not found] <mailman.12589.1212476938.18990.help-gnu-emacs@gnu.org>
2008-06-03  7:31 ` Ralf Angeli
  -- strict thread matches above, loose matches on Subject: below --
2008-06-03  6:58 alruccaba

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.