[^\x20-\x7E] 在正则表达式中的用途 [英] Purpose of [^\x20-\x7E] in regular expressions
本文介绍了[^\x20-\x7E] 在正则表达式中的用途的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
[^\x20-\x7E]
我看到此模式用于正则表达式,其目标是删除非 ascii字符串中的字符.什么意思?
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 mean?
推荐答案
它说的是:所有不在 \x20-\ 范围内的字符 (
(十六进制 ^
)x7E0x20
到 0x7E
).
It says something like: all characters that are not (^
) in the range \x20-\x7E
(hex 0x20
to 0x7E
).
根据http://www.asciitable.com/,这些是从空格到~
.
According to http://www.asciitable.com/, those are characters from space to ~
.
这篇关于[^\x20-\x7E] 在正则表达式中的用途的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文