chicken-janitors
[Top][All Lists]
Advanced

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

Re: [Chicken-janitors] #1189: string-substitute \NUM syntax with precedi


From: Chicken Trac
Subject: Re: [Chicken-janitors] #1189: string-substitute \NUM syntax with preceding backslashes
Date: Sun, 06 Sep 2015 14:52:50 -0000

#1189: string-substitute \NUM syntax with preceding backslashes
-------------------------+--------------------
  Reporter:  retroj      |      Owner:
      Type:  defect      |     Status:  closed
  Priority:  major       |  Milestone:  4.11.0
 Component:  extensions  |    Version:  4.9.x
Resolution:  invalid     |   Keywords:
-------------------------+--------------------
Changes (by sjamaan):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 This seems to be an undocumented feature of the substring-replace
 function, which allows you to escape the backslash. I would recommend
 using irregex, the regex egg's API is kind of deprecated anyway, and it's
 also not very efficient.

 Here's how to do this using irregex:

 {{{
 #;1> (use irregex)
 #;2> (irregex-replace #\, "a,b" "\\" 0)
 "a\\,b"
 }}}

 You can also use irregex-replace/all if you want to replace more than just
 the first occurance.

--
Ticket URL: <http://bugs.call-cc.org/ticket/1189#comment:2>
CHICKEN Scheme <http://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.

reply via email to

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