RosettaCodeData/Task/Regular-expressions/Common-Lisp/regular-expressions-5.lisp
Ingy döt Net b83f433714 tasks a-s
2013-04-10 23:57:08 -07:00

6 lines
232 B
Common Lisp

[2]> (defun regexp-replace (pat repl string)
(reduce #'(lambda (x y) (string-concat x repl y))
(regexp:regexp-split pat string)))
REGEXP-REPLACE
[3]> (regexp-replace "x\\b" "-X-" "quick foxx jumps")
"quick fox-X- jumps"