Search Patterns given by the user in a very long string, searching for batches in C language