wenbao与正则
http://acm.hdu.edu.cn/showproblem.php?pid=6170
regex,字符串匹配regex_match,regex_replace
1 #include <iostream> 2 #include <string.h> 3 #include <regex> 4 using namespace std; 5 int main(){ 6 int t; 7 scanf("%d", &t); 8 while(t--){ 9 string str, ss; 10 cin >> str >> ss; 11 ss = regex_replace(ss, regex("\\.\\*"), "(.)\\1*"); 12 cout<<(regex_match(str, regex(ss)) ? "yes" : "no")<<endl; 13 } 14 return 0; 15 }
只有不断努力才能进步!