MOO-cows Mailing List Archive

[Prev][Next][Index][Thread]

Re: regexp trouble



Quinn writes:
> At LambdaMOO (1.7.8p4):
> 
> ;match("foo's chicken", "^%([^']+s?%)%'s? *%(.+%)?")
> => {1, 13, {{1, 3}, {7, 13}, {0, -1}, {0, -1}, {0, -1}, {0, -1},
>  {0, -1}, {0, -1}, {0, -1}}, "foo's chicken"}
> 
> At Ghostwheel (1.7.9p2):
> 
> ;match("foo's chicken", "^%([^']+s?%)%'s? *%(.+%)?")
> => {}
> 
> Am I violating one of the new regexp rules there?

Yes.  You put a percent-sign in front of an apostrophe, which is not allowed.
In the old matcher, it apparently meant the same thing as an unadorned
apostrophe, but it has a less trivial meaning in the new matcher (and I don't
want to support that meaning in MOO).  Perhaps I will add code to 1.8.0 to
check for unknown escapes and signal E_INVARG in that case.  In any case, the
pattern should work in both systems if you remove the errant percent-sign.

	Pavel


References:

Home | Subject Index | Thread Index