You might have used regexp similar to `hasSlashAfterHost` to validate input. Checking results of `find` is ok too, but in this case you need to check the return value against `std::string::npos` as well as against 0.