regex: boost::xpressive vs boost::regex

前端 未结 5 1499
醉梦人生
醉梦人生 2021-02-19 12:25

I wanted to do some regular expressions in C++ so I looked on the interwebz (yes, I am an beginner/intermediate with C++) and found this SO answer.

I really don\'t know

5条回答
  •  暖寄归人
    2021-02-19 12:34

    Assuming you're using a reasonably recent compiler, there's a pretty decent chance that it includes a regex package already. Try just doing #include and see if the compiler finds it.

    The only trick to things is that it could be in either (or both) of two different namespaces. Regexes were included in TR1 of the C++ standard, and are also in (the final drafts of) C++11. The TR1 version is in a namespace named tr1, where the standard version is in std, just like the rest of the library.

    FWIW, this is essentially the same as Boost regex, not Boost Xpressive.

提交回复
热议问题