简体   繁体   中英

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. 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 ). 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]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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