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.


/^[\p{L}\p{N},]+$/u

thx, good idea!

You can also try


mb_internal_encoding("UTF-8"); 

mb_regex_encoding('UTF-8');

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

The /u modifier stands for Unicode anyway.