group sequences using oligo file

Mothur has this feature to trim sequences based on an OLIGO file.

I am seeking for an similar feature that can group sequences (instead of trimming sequences) based on an OLIGO file. Of course these oligos may not be found at the end of the sequences, rather more often in the middle of these sequences.