具有unicode属性支持的Qt / C ++正则表达式库 [英] Qt/C++ regular expression library with unicode property support
问题描述
我使用C ++将应用程序从.Net框架转换为Qt。该应用程序广泛使用正则表达式unicode属性,即 \\ \\ p {L},\p {M}
等等。我刚刚发现QRegExp类不支持这个东西(lookbehinds等)。
任何人都可以推荐一个C ++正则表达式库:
- 支持unicode属性
- 在其他方面(即\w匹配超过ASCII字符)
- 作为奖励,支持后退。
请不要指向维基百科的文章;我不相信。该文章说,QRegExp支持unicode属性。除非我真的做错了事,否则不会。我正在寻找一个实际上在项目中使用unicode属性和regex库的人。
ICU是一个成熟,广泛使用的
C / C ++ 和提供
的Java库。
软件应用程序的Unicode和全球化支持。
- 根据非限制性开源许可证发布
- ...
- 正则表达式:ICU的正则表达式完全支持Unicode
,同时提供非常有竞争力的
性能。
I'm converting an application from the .Net framework to Qt using C++. The application makes extensive use of regular expression unicode properties, i.e. \p{L}, \p{M}
, etc. I've just discovered that the QRegExp class lacks support for this among other things (lookbehinds, etc.)
Can anyone recommend a C++ regular expression library that:
- Supports unicode properties
- Is unicode-aware in other respects (i.e. \w matches more than ASCII word characters)
- As a bonus, supports lookbehinds.
Please don't point me to the wikipedia article; I don't trust it. That article says that QRegExp supports unicode properties. Unless I'm really doing something wrong, it doesn't. I'm looking for someone actually using unicode properties with a regex library in a project.
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.
It's also compatible to Boost, see their statement in this regard.
这篇关于具有unicode属性支持的Qt / C ++正则表达式库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!