Lelis
Lelis

Reputation: 325

how to make a regular expression to accept

how to make a regular expression to accept only alphanumeric characters, accents, Asian and Arab?

accept: á í ó ú is 個 の Д

deny: /'.

thanks

Upvotes: 0

Views: 118

Answers (1)

mario
mario

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

Related Questions