Difference between regex_match and regex_search?

前端 未结 4 1973
渐次进展
渐次进展 2020-12-06 09:02

I was experimenting with regular expression in trying to make an answer to this question, and found that while regex_match finds a match, regex_search

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-06 09:38

    I tried to use the regex library in C++11 and I ran into many problems (both using g++ 4.6 and 4.7). Basically, the support is either not there or there is only partial support. That is true even for the SVN version. Here you have a link describing the current status for the SVN version of libstdc++.

    So, for the time being, I guess the best option is to continue using Boost.Regex.

    Alternatively, you can try to use libc++. According to this document, support for regular expressions is complete.

提交回复
热议问题