I have the following simple test which doesnt return true for some reason.
string[] test = new string[] { "A", " ", " ", "D", "" };
Regex reg = new Regex(@"^[A-Z]\s$");
bool ok = test.All(x => reg.IsMatch(x));
I've also tried putting the \s inside the square brackets but that doesn't work either
I want to make sure that all characters in the array that are not empty or blank spaces match A-Z.
I realise I could do a Where(x=>!String.IsNullorEmpty(x) && x != " ") before the All but I thought Regex could handle this scenario
Alltrivially.