Bob Bullock wrote: > Note that when you fail a test for the second or third etc > character in trying to test for a sequence of characters on they > fly like this, when you loop back to start, you may want to have > stuffed the character that just failed back into the stream to > check from. In fact, you may want to stuff all of the characters > back in except the very first character, this depends a bit on what > you are trying to find. > > For example, if I am parsing for the sequence AABC and I encounter > the sequence AAABCD the routine will match the first two AA's and > reset on the third A. Unless you just dropped the first character > in the sequence, you would miss your string. Bob: As long as you're storing all those characters anyway (for "stuffing back in" when you fail a match), why not simply wait until you see the LAST character in your target string, then look back at the just- received characters to see if they match the rest of the characters in your target string? Seems a lot easier... -Andy === Andrew Warren -- aiw@cypress.com === Principal Design Engineer === Cypress Semiconductor Corporation === === Opinions expressed above do not === necessarily represent those of === Cypress Semiconductor Corporation -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body