Regex for all PRINTABLE characters

前端 未结 6 1350
囚心锁ツ
囚心锁ツ 2020-12-11 01:09

Is there a special regex statement like \\w that denotes all printable characters? I\'d like to validate that a string only contains a character that can be printed--i.e. do

6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-11 01:20

    Adding on to @Alan-Moore, \P{Cc} is actually as example of Negative Unicode Category or Unicode Block (ref: Character Classes in Regular Expressions). \P{name} matches any character that does not belong to a Unicode general category or named block. See the referred link for more examples of named blocks supported in .Net

提交回复
热议问题