[cl-ppcre-devel] Multi-line-mode confusion...
Chris Dean
ctdean at sokitomi.com
Mon May 1 02:42:56 UTC 2006
>> (cl-ppcre:scan
>> (cl-ppcre:create-scanner "(.*?)c.*?" :multi-line-mode t)
Perhaps you mean :single-line-mode ?
The Perl terminology can be confusing (I always have to look it up!)
cl-ppcre says:
The symbols :CASE-INSENSITIVE-P, :CASE-SENSITIVE-P,
:MULTI-LINE-MODE-P, :NOT-MULTI-LINE-MODE-P, :SINGLE-LINE-MODE-P, and
:NOT-SINGLE-LINE-MODE-P are equivalent to Perl's embedded modifiers
"(?i)", "(?-i)", "(?m)", "(?-m)", "(?s)", and "(?-s)".
perlre says:
m Treat string as multiple lines. That is, change "^" and "$" from
matching the start or end of the string to matching the start or
end of any line anywhere within the string.
s Treat string as single line. That is, change "." to match any
character whatsoever, even a newline, which normally it would not
match.
Regards,
Chris Dean
Gary King <gwking at metabang.com> writes:
> If I can pull people attention away from the International Lisp
> conference (!)...
>
> Perhaps I'm missing something but both
>
>> (cl-ppcre:scan
>> (cl-ppcre:create-scanner "(.*?)c.*?")
>> "a
>> b
>> c
>> d
>> e")
>
> and
>
>> (cl-ppcre:scan
>> (cl-ppcre:create-scanner "(.*?)c.*?" :multi-line-mode t)
>> "a
>> b
>> c
>> d
>> e")
>
> return the same values: 4 5 #(4) #(4).
>
> I expected the second form to return 0 4 #(0) #(4). Where have I gone
> wrong...
>
> thanks.
> --
> Gary Warren King
> metabang.com
> http://www.metabang.com/
> (413) 210 7511
> gwking on #lisp (occasionally)
>
>
> _______________________________________________
> cl-ppcre-devel site list
> cl-ppcre-devel at common-lisp.net
> http://common-lisp.net/mailman/listinfo/cl-ppcre-devel
More information about the Cl-ppcre-devel
mailing list