Qt / C ++ regex library with unicode support

I am converting an application from .Net to Qt using C ++. The application makes extensive use of the unicode properties of a regular expression , i.e. \p{L}, \p{M} , etc. I just found that the QRegExp class lacks support for this, by the way (lookbehinds, etc.).

Can anyone recommend a C ++ regex library that:

  • Supports unicode properties
  • Unicode in other respects (i.e., \ w matches ASCII characters)
  • As a bonus, lookbehinds is supported.

Please do not give me a wikipedia article; I do not believe this. This article states that QRegExp supports unicode properties. If I really am not mistaken, this is not so. I am looking for someone who really uses the unicode properties with the regex library in a project.

+3
source share
2 answers

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

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

  • released under unlimited access license
  • ...
  • Regular Expression: ICU regular expressions fully support Unicode while providing very competitive performance.

It is also compatible with Boost , see their statement in this regard .

+4
source

There should be nothing to stop you from using PCRE ( http://www.pcre.org/ ), although converting from QStrings to const char * s can be a pain / performance hit.

0
source

All Articles