I don\'t need to validate that the IP address is reachable or anything like that. I just want to validate that the string is in dotted-quad (xxx.xxx.xxx.xxx) IPv4 format, w
Boost.Asio provides the class ip::address. If you just want to verify the string, you can use it like this:
std::string ipAddress = "127.0.0.1";
boost::system::error_code ec;
boost::asio::ip::address::from_string( ipAddress, ec );
if ( ec )
std::cerr << ec.message( ) << std::endl;
This also works for hexadecimal and octal quads. This is also a much more portable solution.