I want to create regex, that will match second names with whitespaces and dashes, like:
Smith-Wright
Smith
Smith Wright
But if you will enter just - or whitespace, it shouldn't work. For now I have a regex like ^[a-zA-Z\s\-]+$, but it watches words with only - and whitespaces. How to create regex that will match words with only my separators?