match validation in model's rules

I have a problem in my model:

array('tags', 'match', 

'pattern' => '/^[\x{4e00}-\x{9fa5},]+|[\w\s,]+$/u', 

'message' => 'tags can only contain word characters'),

this rule represent I will validate English word or Chinese word which sperate by comma,but PHP can only match Chinese word?why?how to code this pattern?


For me it works.

Does this work for you? Should match letters and numbers in any language.


thx, good idea!

You can also try



at the entrypoint index.php in your application in case PHP is configured otherwise.

The /u modifier stands for Unicode anyway.