basically I need a preg_match that ensures that only one space character is allowed between each word (IF there is more than one word).
My existing rule is:
It depends what you mean by "word", but assuming you mean letters in A-Z or a-z you can try this:
^[a-zA-Z]+( [a-zA-Z]+)*$
Note that \s does not mean the space character - it means any whitespace, including a new line.
/^[\S]+\s?[^\s]?/i
Will search for any word with one space after it and not a space after that one space
/\s?\S+\s/
Will search for any character with whitespace on either side or only on the end.
i think to specify a number of occurences to your match you put i.e{1} {1,5} (to match only 1 or between 1 and 5 inclusive) so something like...
^[A-Za-z]+( {1})$