Copy StringValidator pattern to other types