> >
> > I'll try your suggestion.
> >
> I tried \w+\s\w+ (plus instead of * in order to require at 
> least one), 
> and it still accepts more than two strings, e.g. "xxx yyy zzz"...

Are you including the special start of line "^" and end of line "$"
characters in your regular expression. Unless you do, it will match the
first occurrence of two words in the text rather than require that there be
exactly two words in the text. In fact, I assume you don't mind if there is
leading or trailing spaces (or even additional spaces between first and
second word). So, I think you want:

  ^\s*\w+\s+\w+\s*$

This will require exactly two words with optional leading/trailing spaces
and even allow for more than one space between the two required words.

-Van

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to