Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php regex and chinese characters

I'm trying to extract the date "25/01/2005", the company name "A One Investment Company Limited 大一投資有限公司", the Chinese name "大一投資有限公司" and the licence number "ABG896" from this string:

Name: A One Investment Company Limited 大一投資有限公司(ABG896) Date of Licence: 25/01/2005 Remarks


However I have no idea how to extract all the data INCLUDING the chinese signs into an array.

like image 661
Sarah Avatar asked Dec 29 '10 10:12

Sarah


1 Answers

If your string is encoded as utf-8, set /u mode and use \p{L} to match unicode letters or use \X as a replacement for .. Note that \X matches newlines, whereas . does not.

See this page for further details.

like image 188
moinudin Avatar answered Sep 26 '22 02:09

moinudin