MCPcopy Create free account
hub / github.com/BatchDrake/SigDigger / urlIsValid

Method urlIsValid

Components/AddTLESourceDialog.cpp:26–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24using namespace SigDigger;
25
26bool
27AddTLESourceDialog::urlIsValid(QString const &url)
28{
29 const std::regex pattern(
30 "((http|https)://)(www.)?[a-zA-Z0-9@:%._\\+~#?&//=]{2,256}\\.[a-z]{2,6}"
31 "\\b([-a-zA-Z0-9@:%._\\+~#?&//=]*)");
32 std::string asStdString = url.toStdString();
33
34 if (url.isEmpty())
35 return false;
36
37 return std::regex_match(asStdString.c_str(), pattern);
38}
39
40void
41AddTLESourceDialog::connectAll(void)

Callers 1

onFieldsChangedMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected