This works fine in all online regex testers but fails to produce any matches in boost::regex_match, which I unfortunately must use as is because it is being used in a system that expects this format for more complicated parsings of street names.
std::string rformat = "(([a-zA-Z]*)|([0-9]*))?";
std::string source = "NASIONAL12";
const boost::regex piecesRegex(rformat);
boost::smatch piecesMatch;
if (boost::regex_match(source, piecesMatch, piecesRegex))
{
for (auto match : piecesMatch) {
std::cerr << "MATCH:" << match << std::endl;
}
}
What I need is for the first "piecesMatch" to return "NASIONAL" and the second "piecesMatch" to return "12"