sorry for the lack of precision on the motifs distribution . the patterns should be intermixed and all the sequence should be treated as one string. If you can guide me on cpan modules that may refer to some of my needs it will be sufficient I think.