Reputation: 325
how to make a regular expression to accept only alphanumeric characters, accents, Asian and Arab?
accept: á í ó ú is 個 の Д
deny: /'.
thanks
Upvotes: 0
Views: 118
Reputation: 145512
You can use Unicode character classes to pick and choose.
Not sure, but I guess in your case that would be:
preg_match('/^[\p{Latin}\p{Han}\p{Arabic}]+$/u'
Upvotes: 1