i'm really new on C++ and i want to try a little bit C++. Normally i'm come from Java/PHP.
I have a String like;
std::string location = "file:///C:/Program Files (x86)/Demo/";
or
std::string location = "http://www.example.com/site.php";
How i can check:
- a has
location
the domainwww.example.com
orexample1.com
- b starts the domain with
http://
orhttps://
In Java or PHP i would take Regular Expression. But simply no idea how to start in C++.
My first things was to check http://
:
std::string location = "";
if (strncmp(location.c_str(), "http://", 7)) {
/* yepp */
} else {
/* nope */
}
But that won't work.
I hope you can help me.