Skip to content

Instantly share code, notes, and snippets.

@naaando
Created February 15, 2017 15:56
Show Gist options
  • Save naaando/3c3d85d2eadf4bc41ded198434e8bac5 to your computer and use it in GitHub Desktop.
Save naaando/3c3d85d2eadf4bc41ded198434e8bac5 to your computer and use it in GitHub Desktop.
// #include <cstdlib>
#include <iostream>
#include <boost/regex.hpp>
using namespace std;
using namespace boost;
int main(int argc, char *argv[]) {
string str = "2";
regex re("[0-9]");
try{
re.assign(str, boost::regex_constants::icase);
}
catch(boost::regex_error e){
cout << e.what() << endl;
}
try{
if (boost::regex_match(str, re)){ // O erro no link aparece aqui...
cout << "Encontrado..." << endl;
}
else
cout << "Nn Encontrado..." << endl;
}
catch(boost::regex_error e){
cout << e.what() << endl;
}
// system("pause");
return EXIT_SUCCESS;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment