Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. string AddressUnparsed = "collectief@test.nl";
  2. smatch matchesAddress;
  3.  
  4. if (regex_search(AddressUnparsed, matchesAddress, regex("([^@\s]+@[^@\s]+\.[a-zA-Z]{2,})", regex_constants::ECMAScript | regex_constants::icase))) {
  5. cout << "Match!. The emailaddress is: " << matchesAddress[1] << endl;
  6. }
  7. else {
  8. cout << "No match!" << endl;
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement