Do C++11 regular expressions work with UTF-8 strings?

后端 未结 4 2226
一个人的身影
一个人的身影 2020-12-01 07:57

If I want to use C++11\'s regular expressions with unicode strings, will they work with char* as UTF-8 or do I have to convert them to a wchar_t* string?

4条回答
  •  执念已碎
    2020-12-01 08:17

    C++11 regular expressions will "work with" UTF-8 just fine, for a minimal definition of "work". If you want "complete" Unicode regular expression support for UTF-8 strings, you will be better off with a library that supports that directly such as http://www.pcre.org/ .

提交回复
热议问题