Configure Boost in Windows
- Compiler selection
- CMakeLists file, set the Boost header file and library file path
- Code test
#include <iostream> #include <string> #include <boost/regex.hpp> int main(int, char**) { std::string str("acc133acc133"); boost::regex e(R"(\d+)"); boost::smatch m; if(boost::regex_search(str, m, e)){ std::cout << m.str() << std::endl; }else{ std::cerr << "erro\n"; } }
- operation result
- [Note] Reference : https://www.bilibili.com/video/BV1zt4y1C7T9