I want to match all expressions with exactly one whitespace. Currently, I\'m using [^\\\\s]*\\\\s[^\\\\s]*. That doesn\'t seem like a very good way, though.
[^\\\\s]*\\\\s[^\\\\s]*
You could also check it with indexOf:
indexOf
String s = "some text"; int indexOf = s.indexOf(' '); boolean isOneWhitespace = (indexOf >= 0 && indexOf == s.lastIndexOf(' '));