I want a regular expression that prevents white spaces and only allows letters and numbers with punctuation marks(Spanish). The regex below works great, but it doesn't allow punctuation marks.
^[a-zA-Z0-9_]+( [a-zA-Z0-9_]+)*$
For example, when using this regular expression "Hola como estas" is fine, but "Hola, como estás?" does not match.
How can I tweak it to punctuation marks?