regex to disallow whitespace
I'm looking for a regex that will allow Alpha Numeric and most all special characters except white space. It should be usable in c#. It would be nice if .net supported posix style but I can't seem to get it to work. T开发者_StackOverflowIA
Pretty sure \S (note capitalization) is the non-whitespace character class.
Something along the lines of: [^\s]+
should do the trick.
This roughly translates as "match one or more consecutive characters that are not whitespace" (\s
matches a space, tab, or line break).
精彩评论