I like it yes that will work nicely. Sorry it was just a module of a larger piece to find motifs in a fasta formatted data set containing multiple fasta sequences from a file which I input as asked. I parsed the fasta sequence w/ a foreach loop and after each is parsed it runs this (match) part of the loop on the sequence data to discover whether the sequence contains the motifs or patterns. I only need one match per pattern, but have multiple patterns and require ID of each match case (ie only return pies once despite the number of occurrences; if pies and weed is found multiple times return both, but only once to indicate presence.