You are viewing a single comment's thread. Return to all comments →
In c++ using regex expressions, but you have to include <regex> header
int main(){ int N; cin >> N; regex e(".+@gmail\\.com$"); vector<string> db; for(int a0 = 0; a0 < N; a0++){ string firstName; string emailID; cin >> firstName >> emailID; if(regex_match(emailID,e)){ db.push_back(firstName); } } sort(db.begin(),db.end()); for(int i = 0;i < db.size();i++) { cout << db[i] << endl; } return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Day 28: RegEx, Patterns, and Intro to Databases
You are viewing a single comment's thread. Return to all comments →
In c++ using regex expressions, but you have to include <regex> header