mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralsec.git
synced 2025-11-01 19:27:59 +00:00
Initial checkin for username creation
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user