John Maddock wrote:
That's basically what it does, but when the first potential match is found it "accidentally" ends up computing the length of the whole sequence, I'm testing the patch below now, all being well it should be in cvs shortly.
Thank you for looking at this issue. I tried your patch and it worked on the regex "(aaa)|(bbb)|(.)|(\n)" But I suspect it isnt the whole story, as I have the same 'seeking to end' problem with the more realistic tokeniser regex "(aaa)|([a-zA-Z][a-zA-Z0-9_-]*)|(.)|(\n)" where I'm looking for the longest identifier, but want 'aaa' treated as a keyword provided it isnt followed by other alphanums. In the foo4.cc file I sent, I changed expression.assign("(aaa)|([a-zA-Z][a-zA-Z0-9_-]*)|(.)|(\n)", sflag); and MyCharIter& MyCharIter::operator--(){ // prefix --X cout << "NT: --X called bp=" << bp << " c= '" << s[bp] <<"'" << endl; --bp; return *this; } as this function is now needed. I also wondered if the fact that match_continuous is set is relevant since all (toplevel) matches will start at the same place. David McKelvie