> Notice by the way that the plugin does not support calls like
> re.create("(ab)(cd)").fullmatch("abcd", "", "bbb")
> which is trying to grab only the second match.  The docs for pcrecpp 
> says that it does, although looking at the code which scans args in 
> fullmatch, it seems to me he also stops looking at args when he finds 
> a missing one.  But I may be wrong.

This doesn't make much sense since the library should be expecting
pointers to empty strings as arguments. Anyway, it's easy enough to 
fix... replacing this:
        *for (n=0; n<MAX_STRINGARGS; n++)
        {
                if (!**(szargs+n+3))
                        break;
                s[n].assign(*(szargs+n+3));
        }
with this:
        n=nargs-2;
seems to allow empty arguments. I don't know if empty arguments could 
create problems in the rest of your code though.

> I did notice that there is a leak in my plugin if the re constructor 
> of pcrecpp fails and I set error string.  I should delete the re 
> object that is created when I set the error message.  Probably not 
> going to happen that much.

I'll probably upload another version anyway (with the above bugfix) so 
you can send me updated code if you want... or just tell me exactly what 
I should change (I still haven't read the rest of code ;-).

Reply via email to