[cl-ppcre-devel] Bug?

Edi Weitz edi at agharta.de
Mon Jul 7 09:25:51 UTC 2008


On Mon, 7 Jul 2008 10:17:12 +0100, "Dave Pawson" <dave.pawson at gmail.com> wrote:

> Input text
>
>   * Representatives from  <Sun> & <Novell> versions) & <Symphony>,
> <KOffice>, <Google> Docs & Spreadsheets and Microsoft Office.
>
> code
>
> (defun msg(message)
>   (format t "~%~A~%" message)
> )
>
> (defun cleanup (line)
> "Replace < and & with entities"
>   (msg (cl-ppcre:regex-replace-all "&" line "&"))
>   (msg (cl-ppcre:regex-replace-all "<" line "<"))
>   )
>
>
> The first message replaces &
> The second shows that & has been changed back to &

You're applying REGEX-REPLACE-ALL to LINE in both cases.  You probably
want to apply it to the result of the first invocation in the second
case instead.



More information about the Cl-ppcre-devel mailing list