RosettaCodeData/Task/Regular-expressions/Common-Lisp/regular-expressions-3.lisp
2023-07-01 13:44:08 -04:00

5 lines
215 B
Common Lisp

(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'."))))