<br><br><div class="gmail_quote">On Thu, Apr 19, 2012 at 14:26, Eli Barzilay <span dir="ltr"><<a href="mailto:eli@barzilay.org">eli@barzilay.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Two hours ago, Laurent wrote:<br>
<br>
> Maybe also a `string-replace' could be useful, especially when one<br>
> does not want regexps and has special characters that need to be<br>
> quoted.<br>
<br>
Again, it's not clear how this shold look -- my guess:<br>
<br>
(define (string-replace from str to)<br>
(regexp-replace* (regexp-quote from) str to))<br></blockquote><div><br>I meant this:<br><br>(define (string-replace from str to)<br> (regexp-replace* (regexp-quote from) str (regexp-replace-quote to)))<br><br>(string-replace "(" "(a list)" "\\1") ; -> "\\1a list)"<br>
<br></div></div>Newbie-friendly (I meant regexp-quoted without the user seeing it) and easy to use.<br><br>Laurent<br>