method regex handles array types