Initial checkin for username creation

This commit is contained in:
stephb9959
2021-07-08 19:23:29 -07:00
parent 23cf3447c7
commit d3ca22b18e
24 changed files with 1095 additions and 861 deletions

View File

@@ -8,6 +8,7 @@
#include <stdexcept>
#include <fstream>
#include <cstdlib>
#include <regex>
#include "Utils.h"
@@ -390,4 +391,12 @@ namespace uCentral::Utils {
}
}
bool ValidEMailAddress(const std::string &email) {
// define a regular expression
const std::regex pattern
("(\\w+)(\\.|_)?(\\w*)@(\\w+)(\\.(\\w+))+");
// try to match the string with the regular expression
return std::regex_match(email, pattern);
}
}