Choosing specific files for each subject

Hi,
In my data set I have a 4 runs per subject per session. Each run is actually one block. I would like to run through subject and pick whole 4 runs. My issue is - within the same folder I have another resting state run (distinguished only by task number). So If I have task-3(4,5,6) as blocks, task-7 is RS.
How can I pick only these four files?
I use IdentityInterface and SelectFiles.

Thank you