
Untitled
By: a guest on
Jan 21st, 2013 | syntax:
C++ | size: 0.38 KB | hits: 14 | expires: Never
int _tmain(int argc, _TCHAR* argv[])
{
string email1S = "abc 31432";
cmatch results;
regex mcn("([[:digit:]]+)");
string::const_iterator curPosition = email1S.begin();
if (regex_search(curPosition, email1S.cend(), results, mcn))
{
cout << "We have a match" << endl;
cout << results[1].str() << endl;
}
curPosition += results[0].length();
cin.get();
return 0;
}