php 正则表达式和汉字

发布于 2024-10-10 00:55:29 字数 236 浏览 0 评论 0原文

我试图从其中提取日期“25/01/2005”、公司名称“A One Investment Company Limited 大一投资有限公司”、中文名称“大一投资有限公司”和许可证号“ABG896”这个字符串:

名称:A One Investment Company Limited 大一投资有限公司(ABG896) 许可证日期:25/01/2005 备注


但是我不知道如何将包括中文符号在内的所有数据提取到数组中。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凉月流沐 2024-10-17 00:55:29

如果您的字符串编码为 utf-8,请设置 /u 模式并使用 \p{L} 匹配 unicode 字母或使用 \X作为 . 的替代品。请注意,\X 匹配换行符,而 . 则不匹配。

请参阅此页面了解更多详细信息。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文