Email: bknpk@hotmail.com Phone: +972-54-7649119


V

 

Simple c++ exercise, which uses boost to implement regular expression. Similar projects can be seen at c++: main page

  1. #include <boost/regex.hpp>
  2. #include <string>
  3. #include <iostream>
  4. using namespace std;
  5. int main() {
  6.   string str("This is an 12 example");
  7.   static const boost::regex exp(".*(an *[0-9]*).*");
  8.   if (boost::regex_match(str, exp)) {
  9.     cout << str << str << endl;
  10.     cout << "exp " << exp << endl;
  11.   }
  12.   return 0;
  13. }
  14. //g++ -g -I /usr/local/include/boost-1_33_1 boost.cpp /usr/local/lib/libboost_regex-gcc-1_33_1.a

  ...


Search This Site


Feedback This Site





new pages on this site