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 &
* Representatives from <Sun> & <Novell> versions) & <Symphony>, <KOffice>, <Google> Docs & Spreadsheets and Microsoft Office.
* Representatives from <Sun> & <Novell> versions) & <Symphony>, <KOffice>, <Google> Docs & Spreadsheets and Microsoft Office.
regards
On Mon, 7 Jul 2008 10:17:12 +0100, "Dave Pawson" dave.pawson@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.
2008/7/7 Edi Weitz edi@agharta.de:
(defun cleanup (line) "Replace < and & with entities" (msg (cl-ppcre:regex-replace-all "&" line "&")) (msg (cl-ppcre:regex-replace-all "<" line "<")) )
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.
Oh dear. Sorry for wasting bandwidth.
Thanks Edi.
regards
cl-ppcre-devel@common-lisp.net