Why use a regular expression? You didn't specify a language, so the following is in C#:
var count = (from c in myString
where c == ' '
select c).Count();
valid = (count == 2 || count == 0);
Depending on the environment/context, I'd consider wait until it's time to parse the string, and validate it as part of the act of parsing:
string[] parts = myString.Split(" ");
if (parts.Length != 1 || parts.Length != 3)
{
return;
}