The 'standard' way to construct a character class that excludes characters is [^...].
One way to define the class of all whitespace except a newline would be [^\S\n]. (Note this the big-S \S which is the inverse of \s i.e., \S matches any character that is not whitespace.) So this is a kind of double-negative. You might read it as "the class of all characters that are not non-whitespace and also not a newline."
In reply to Re: regex doubt on excluding
by AnomalousMonk
in thread regex doubt on excluding
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |