Updated pattern to reject leading and trailing spaces. Fixed an ExcludesRange test to use the correct count with the Enumerable.Range method.