8 lines
297 B
C++
8 lines
297 B
C++
#include "util.h"
|
|
#include <regex>
|
|
|
|
bool url::is_url_valid(std::string &url) { static std::regex r("https?:\\/\\/[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)");
|
|
std::cmatch m;
|
|
return std::regex_match(url.c_str(), m, r);
|
|
}
|