The \\s (lowercase s ) matches a whitespace (blank, tab \ , and newline \\r or \
). On the other hand, the \\S+ (uppercase S ) matches anything that is NOT matched by \\s , i.e., non-whitespace.