In Perl \\S matches any non-whitespace character.
\\S
How can I match any non-whitespace character except a backslash \\?
\\
You can use a lookahead:
/(?=\S)[^\\]/