RosettaCodeData/Task/Regular-expressions/Common-Lisp/regular-expressions-3.lisp

6 lines
215 B
Common Lisp
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
(let ((string "I am a string"))
(multiple-value-bind (string matchp)
(cl-ppcre:regex-replace "\\bam\\b" string "was")
(when matchp
(write-line "I was able to find and replace 'am' with 'was'."))))