#include <iostream>
#include <std::string>

std::string domain() {
    std::string tmpstr;
    
    size_t lpos = 0; 
    lpos = urlOrDomain.find("@"); //detect if there are credentials in the url and strip them
    if (lpos == std::string::npos)
    {
        //no credentials located. go over protocol if there one
        lpos = urlOrDomain.find("://");
        if (lpos != std::string::npos)
        {
            lpos += 3; //go over "://"
        }
    }
    else {
        lpos++; //go over @
    }
    if (lpos > urlOrDomain.size() - 1)
    {
        lpos = 0;
    }

    tmpstr = urlOrDomain.substr(lpos);
    lpos = tmpstr.find('/');
    if (lpos != std::string::npos)
    {
        tmpstr = tmpstr.substr(0, lpos);
    }
    return tmpstr.c_str();
    
}

int main() {
    
    
}