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

Edi Weitz edi at agharta.de
Tue Jul 13 07:10:28 UTC 2004


On Tue, 13 Jul 2004 05:57:42 -0700, Jan Rychter <jan at rychter.com> wrote:

> 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)

Yes, this looks like a bug. I'll try to fix this ASAP. Thanks for the
report.

Cheers,
Edi.




More information about the Cl-ppcre-devel mailing list