Template:cpp/regex/example common


 * 1) include
 * 2) include
 * 3) include

void show_matches(const std::string& in, const std::string& re) {   std::smatch m;    std::regex_search(in, m, std::regex(re)); if(!m.empty) { std::cout << "input=[" << in << "], regex=[" << re << "]\n " "prefix=[" << m.prefix << "]\n smatch: "; for(std::size_t n = 0; n < m.size; ++n) std::cout << "m[" << n << "]=[" << m[n] << "] "; std::cout << "\n suffix=[" << m.suffix << "]\n"; } else { std::cout << "input=[" << in << "], regex=[" << re << "]: NO MATCH\n"; } }