Advertisement
Guest User

Untitled

a guest
Jan 21st, 2013
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. int _tmain(int argc, _TCHAR* argv[])
  2. {
  3.     string email1S = "abc 31432";
  4.     cmatch results;
  5.     regex mcn("([[:digit:]]+)");
  6.     string::const_iterator curPosition = email1S.begin();
  7.  
  8.     if (regex_search(curPosition, email1S.cend(), results, mcn))
  9.     {
  10.         cout << "We have a match" << endl;
  11.         cout << results[1].str() << endl;
  12.     }
  13.     curPosition += results[0].length();
  14.     cin.get();
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement