patterns to array function