I have this regex:
var alphaExp = /^[a-zA-ZåäöÅÄÖ\s]+$/;
This is for a name-field in a form validation.
I need to make it possible to type names like this "Anna-nicole" (note the minus sign). Currently the minus sign causes error.
I need to remake this regex so that a minus sign can be included in the name, preferrably make it so that the name also CANT start with a minus sign, or end with one. Only minus signs between "words, or names" should be allowed.
Anybody know how to do this?
Btw, it is javascript.
Thanks