#include <iostream>
#include <string>
#include <regex>

using namespace std;

int main () {
    regex rxWorld("world");
    const string text = "hello world!";
    const auto t0 = text.cbegin();
    smatch match;
    const bool ok = regex_search(text, match, rxWorld);
    cout << "  text:'" << text
         << "' ok:" << ok
         << " size:" << match.size()
         << " pos:" << match.position()
         << " len:"<< match.length()
         << endl;
}
