gpt4 book ai didi

c++ - 具有 unicode 属性支持的 Qt/C++ 正则表达式库

转载 作者:太空狗 更新时间:2023-10-29 21:08:32 26 4
gpt4 key购买 nike

我正在使用 C++ 将应用程序从 .Net 框架转换为 Qt。该应用程序广泛使用 regular expression unicode properties ,即 \p{L}、\p{M} 等。我刚刚发现 QRegExp 类缺乏对此的支持(lookbehinds 等)

谁能推荐一个 C++ 正则表达式库:

  • 支持 unicode 属性
  • 在其他方面是否支持 unicode(即\w 匹配的字符多于 ASCII 字符)
  • 作为奖励,支持回顾。

请不要将我指向维基百科文章;我不相信它。那篇文章说 QRegExp 支持 unicode 属性。除非我真的做错了什么,否则不会。我正在寻找在项目中实际使用带有正则表达式库的 unicode 属性的人。

最佳答案

http://site.icu-project.org/

ICU is a mature, widely used set of C/C++ and Java libraries providing Unicode and Globalization support for software applications.

  • released under a nonrestrictive open source license
  • ...
  • Regular Expression: ICU's regular expressions fully support Unicode while providing very competitive performance.

它也兼容 Boost , 请参阅 their statement in this regard .

关于c++ - 具有 unicode 属性支持的 Qt/C++ 正则表达式库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2820367/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com