I need to match two words that usually are joined with a dash '-' and sometimes 0, 1 or 2 white spaces. I decided to use the following Regex pattern to solve the problem: [.\s]*
However that pattern does not match this case: "word1-word2"
The following pattern solves the problem: .*\s*
for all the cases.
All the cases:
word1-word2
word1word2
word1 word2
word1 word2
I am currently using the second pattern, however I would like to know the subtle diference between them. If it is of any help I am using C#.
Regards