For whatever reason, the regexp I made for my program will not match to lines that match in any other implementation. I'm wondering if there's some new syntax I'm not understanding?
Here's my own implementation:
std::string line, pattern("[LS] 0x[0-9a-fA-F]{8}");
std::regex rx(pattern, std::regex::basic);
uint line_count = 0;
while (getline(in_file, line))
{
line_count++;
if (std::regex_match(line, rx))
{
bool type = (line[0] == 'L');
uint address = (uint) std::stoul(line.substr(4, 8), nullptr, 16);
m_type_store.push_back(type);
m_address_store.push_back(address);
} else {
std::cerr << line << " |" << line_count << '|' << std::endl;
in_file.close();
exit(1);
}
}
And every time it cannot match the first line of the file, which is exactly:
S 0x0022f5b4
And that looks completely fine to me... Am I missing something?