Module: Iterate over all subpatterns of a given mask