简单正则匹配不成功
#include <iostream>
#include <string>
#include <regex>
using namespace std;
int main() {
string str = ".method public native testIntFromCarson()I";
regex pattern("met*od");
smatch m;
if(regex_search(str, m, pattern)) {
cout << "match" << endl;
} else {
cout << "not match" << endl;
}
}
#include <iostream>
#include <string>
#include <regex>
using namespace std;
int main() {
string str = ".method public native testIntFromCarson()I";
regex pattern(string("met.*od"));
smatch m;
if(regex_search(str, m, pattern)) {
cout << "match" << endl;
} else {
cout << "not match" << endl;
}
return 0;
}
//match
//