I'm trying to extract the domain from a URL. Following is an example script.
#include <iostream>
#include <string>
#include <boost/regex.hpp>
int main () {
std::string url = "http://mydomain.com/randompage.php";
boost::regex exp("^https?://([^/]*?)/");
std::cout << regex_search(url,exp);
}
How do I print the matched value?