MLUG: Re: [MLUG] String manipulation in C
Re: [MLUG] String manipulation in C
Email address obfuscation in effect -- please click here to turn it off.

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


On Mon, 2 Jul 2007, Jack Smith wrote:

I think I have it figured out. I did so by calling my match() below to
tell me if there is a match (action = 0). If there was a match, I got
the starting and ending locations from match() with action = 1 and 2. I
set up a cumulative distance counter of pmatch[].rm_eo values returned
and then advanced the string to be searched by that many characters. I
put that in a while loop to keep advancing the string and looking for
matches until there were no more:

strcpy(stringrem, sequence+endLocTotal);

You might want sequence+startLocTotal+1 instead, here, that is, if you want to detect for the possibility of the pattern appearing twice but overlapping - e.g. if pattern is "ABA" and you are searching "XXABABAXX" - do you want the pattern to be found once (which is what your program will do) or twice?






_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members