Changed the pattern syntax to allow logical conditions in the regular expression (for example, a list of arrays)