[cl-ppcre-devel] empty line matches with cl-ppcre

Jan Rychter jan at rychter.com
Tue Jul 13 12:57:42 UTC 2004


I'm confused. I must be doing something wrong.

I have a string:

CL-USER> *str*
"1
2
3

4
"

Just to make sure it's really what it seems:

CL-USER> (loop for c across *str*
               do (format t "~S " c))

#\1 #\Newline #\2 #\Newline #\3 #\Newline #\Newline #\4 #\Newline 
NIL


I wanted to match empty lines, so I did:

CL-USER> (cl-ppcre:regex-replace-all (cl-ppcre:create-scanner "^$" :multi-line-mode t) *str* "!")
"1
2
3
!!
4
!!"

Now, I would normally expect this:

"1
2
3
!
4
"

Playing with regex-coach indeed produces the result I'd normally
expect. What am I doing wrong? (using CMUCL 19a, the testing version,
and CL-PPCRE-0.7.7)

many thanks,
--J.




More information about the Cl-ppcre-devel mailing list