turn array check into a regex