Regex for all PRINTABLE characters

前端 未结 6 1341
囚心锁ツ
囚心锁ツ 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

    It depends wildly on what regex package you are using. This is one of these situations about which some wag said that the great thing about standards is there are so many to choose from.

    If you happen to be using C, the isprint(3) function/macro is your friend.

提交回复
热议问题