11-09-2006 06:29 AM
11-09-2006 06:47 AM
Try: FindPattern(); its in the Formatting and I/O library.
JR
11-09-2006 07:39 AM
Hi and thanks
I know this function and to the best of my knowledge, it can only look for a pattern from a specified index and on....
My request was to find the pattern from a certain index and backwards....
Any idea?
Thanks
11-09-2006 08:34 AM - edited 11-09-2006 08:34 AM
FindPattern can search from right starting not from end of string but from an intermediate point, specified in Number of bytes parameter. For example look at this snippet of code:
char string[32];
strcpy (string, "abcd12bcefg12abcdefg");
FindPattern (string, 0, FindPattern (string, 0, -1, "12", 0, 1), "bc", 0, 1);
it returns 6 which is the index of "bc" that appears before the second "12" (or to the left of the first "12" from right). The second FindPattern searches for the max lenght of string to scan, the first one scans this part of the string from right.
Message Edited by Roberto Bozzolo on 11-09-2006 03:35 PM
11-10-2006 01:03 AM