[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Replace sub-string
From: |
Freeman Gilmore |
Subject: |
Re: Replace sub-string |
Date: |
Thu, 28 May 2020 07:46:56 -0400 |
Arron:
Just getting to this and having a problem. See below.
On Sat, May 23, 2020 at 12:31 AM Aaron Hill <lilypond@hillvisions.com> wrote:
>
> On 2020-05-22 8:38 pm, Freeman Gilmore wrote:
> > Is there a procedure, to replace 'all' occurrences of a sub-string
> > within a string. with a string?
> > If so please give an example.
>
> regexp-substitute/global [1] should do the job.
>
> [1]:
> https://www.gnu.org/software/guile/docs/docs-1.8/guile-ref/Regexp-Functions.html#Regexp-Functions
>
> ;;;;
>
> (regexp-substitute/global #f
> "(c|sh|w)ould of"
> "I would of done that if I could of."
> 'pre 1 "ould have" 'post)
>
> => "I would have done that if I could have."
\version "2.20.0"
#(regexp-substitute/global #f
"(c|sh|w)ould of"
"I would of done that if I could of."
'pre 1 "ould have" 'post)
Gives: Unbound variable: regexp-substitute/global
Also:
\version "2.20.0"
#(regexp-substitute/global #f "[ \t]+" "this is the test" 'pre "-" 'post)
Gives: Unbound variable: regexp-substitute/global
What am i missing?
Thank you, ƒg
>
> ;;;;
>
>
> -- Aaron Hill
>