I'm having trouble validating this string function in this format "Jones Brokers" The string can be less 15 and there must be a space between Jones and Brokers.
#include <iostream>
#include <string>
#include <regex>
usingnamespace std;
int main()
{
regex validName("[[:alpha:]]* [[:alpha:]]*");
cout << "Please enter a first and last name " << flush;
string name = "";
getline(cin, name);
if (name.size() < 15 && regex_match(name, validName))
{
cout << name << " is valid";
}
else
cout << name << " is not valid";
cin.ignore();
return 0;
}