开发者

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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜