[cl-ppcre-devel] possible bug with non-word boundaries and greedy matching

Moshe Looks madscience at google.com
Wed Mar 28 00:52:39 UTC 2012


I have an odd little regular expression \B.* that seems to generate
inconsistent behavior between CL-PPCRE and other regular expression
engines that I've tried it with. Using CL-PPCRE:

CL-USER> (cl-ppcre::scan "\\B.*" "foo bar baz")
NIL

This matches in Perl, PPCRE, and RE2. Am I missing something, or
should CL-PPCRE be matching this as well?

Oddly enough, change * to + leads CL-PPCRE to match:

CL-USER> (cl-ppcre::scan "\\B.+" "foo bar baz")
1
11
#()
#()

It seems like + matching implies that * should as well...

Thanks,
Moshe




More information about the Cl-ppcre-devel mailing list