According to C # documentation :
\W- Matches any non-alphanumeric character.
It seemed to me logical to assume that the underscore character - "_" falls under this definition.
But in practice it turned out that the regular expression - @"\W+" does not find the underscore character in the line - @"@$^№_\|/*-+=~%{}()[];:,.!? "" ""
Please explain why the regular expression does not find the underscore character "_"?
\Wfinds any character other than a word character, but what is meant by this is described there. - Wiktor Stribiżew