简体   繁体   English

非字母数字,非符号字符的正则表达式

[英]Regular Expression for Non-Alphanumeric, Non-Symbol Characters

I am writing a simple form pre-validator. 我正在编写一个简单的表单预验证器。 I am looking for a PHP regular expression to match any irregular symbols. 我正在寻找匹配任何不规则符号的PHP正则表达式。 That is, non-Latic and non-numeric characters, and charachters which are not included in normal English punctuation (basically, match characters not in the second through forth column on this ascii table ). 也就是说,非Latic和非数字字符以及普通英语标点中不包含的字符(基本上,不匹配此ascii表的第二至第四列中的字符)。 Any regexp wizards out there who could help me out? 那里有任何正则表达式向导可以帮助我吗?

The second to fourth column can be translated into a simple regexp: 第二至第四列可以转换为简单的正则表达式:

/[^ -~]/

matches any characters not between space and tilde. 匹配空格和代字号之间的任何字符。

Answer is over here. 答案在这里。

The long & short of this. 多头与空头。 This PCRE: [^\\x00-\\x7F] 此PCRE: [^\\x00-\\x7F]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM