those sequences you don't see because they are in the file I'm parsing not what I posted otherwise I'd have to post the entire 3000 line file. my experience is pretty novice I've been working with perl for about 3 months but I have to write this code myself I don't have any other person's script that I'm editing to make it.
It's a bit more complicated than what you gave me as a response in your code because If you match the first in the header, store it. If then on the next line iteration you have a match to the residues, print out the header and the match. If there's additional matches in the sequence, like the output shows, only print the name of the sequence once, but print out the other hits, like I've shown in the output.
I can easily pull out all the sequences from the file or all the headers but I want to store the header only if the sequence(s) are present on the subsequent line then print them all at once.
my issue is not with working with the regular expressions but more on deciding which kind of loop would be best suited for the task.
Thank you and sorry about my posting etiquette.