Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string AddressUnparsed = "collectief@test.nl";
- smatch matchesAddress;
- if (regex_search(AddressUnparsed, matchesAddress, regex("([^@\s]+@[^@\s]+\.[a-zA-Z]{2,})", regex_constants::ECMAScript | regex_constants::icase))) {
- cout << "Match!. The emailaddress is: " << matchesAddress[1] << endl;
- }
- else {
- cout << "No match!" << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement