add expandPatterns function

expands a list of patterns to it's content, for further usage