转载:https://blog.****.net/fsdad/article/details/52637426
判断url是否合法
const std::regex urlpattern("^(((file|gopher|news|nntp|telnet|http|ftp|https|ftps|sftp)://)|(www\.))+(([a-zA-Z0-9\._-]+\.[a-zA-Z]{2,6})|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(/[a-zA-Z0-9\&%_\./-~-]*)?$");
if (regex_match(strUrl.c_str(), urlpattern))
{
//合法url
}
else
{
//非法url
}