We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
#include<iostream>#include<algorithm>#include<regex>intmain(){std::strings;getline(std::cin,s);std::regexre{"hackerrank"};intcount{0};std::smatchmatch;intfound{std::regex_match(s,match,re)};std::regex_iterator<std::string::iterator>iter(s.begin(),s.end(),re);std::regex_iterator<std::string::iterator>end;while(iter!=end){++iter;count++;}std::cout<<"Number of matches : "<<count;return0;}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Matching Specific String
You are viewing a single comment's thread. Return to all comments →
C++