16,471
社区成员
发帖
与我相关
我的任务
分享
#include <regex>
#include <iostream>
#include <string>
basic_regex<char> regex("[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}",
basic_regex<char>::icase);
cout<< std::boolalpha << regex_match("GoOD@DOMAIN.COM", regex)
<< std::endl;
cout<< std::boolalpha << regex_match("@DOMAIN.COM", regex)
<< std::endl;