This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Regexps




I want to replace all matches of a regexp in a string with
another string. I coudn't get regexp-substitute/global to
work, so I tried something like this, which also didn't work.
How do I really do it?

(define (table-sed-subst-g-regexp-line regexp subst line)
  (let ((regexp-match (regexp-exec regexp line)))
    (cond
     (regexp-match 
      (regexp-substitute #f regexp-match
                         'pre subst 
                         (table-sed-subst-g-regexp-line regexp subst 'post)))
     (else line))))

And why is the second parameter to regexp-substitute/global a
string and not a regexp?

-- 
                                                     -jk