/^(?:\s*\w+\s*)+$/ # if you mean a-z A-Z 0-9 space and '_'