16,548
社区成员




include <regex>
using namespace std;
…………
string t_sSrc = "ABCDE";
regex_constants::syntax_option_type fl = regex_constants::icase;
regex t_Reg("ABC",fl);
smatch t_MR;
bool t_bRe = false;
t_bRe = regex_match(t_sSrc, t_MR, t_Reg);
#include <string>
#include <regex>
#include <iostream>
using namespace std;
void main()
{
string data = "This is : 192.168.0.1";
regex pattern("\\d+");
smatch match;
while (regex_search(data, match, pattern))
{
cout << match[0] << endl;
data = match.suffix();
}
}