regexFactory: work with arrays as well as strings