Purpose of [^\x20-\x7E] in regular expressions

前端 未结 4 1747
情深已故
情深已故 2020-12-13 18:04
 [^\\x20-\\x7E]

I saw this pattern used for a regular expression in which the goal was to remove non-ascii characters from a string. What does it

4条回答
  •  悲哀的现实
    2020-12-13 18:15

    It means "anything that isn't a character code in the hexadecimal range 0x20 to 0x7E, i.e. 32 to 126".

提交回复
热议问题