In Perl S matches any non-whitespace character.
S
How can I match any non-whitespace character except a backslash ?
You can use a character class:
/[^s\]/
matches anything that is not a whitespace character nor a . Here's another example:
[abc] means "match a, b or c"; [^abc] means "match any character except a, b or c".
[abc]
a
b
c
[^abc]
1.4m articles
1.4m replys
5 comments
57.0k users