I’m using the following code to get the image filenames from an HTML file.
The code goes somehow like this:
std::tr1::regex term=(std::tr1::regex)r;
const std::tr1::sregex_token_iterator end;
for (std::tr1::sregex_token_iterator i(s.begin(),s.end(), term); i != end; ++i)
{
std::cout << *i << std::endl;
}
s is a string that is already declared and contains the full string of the file.
r is a string that contains the regex term to look for.
This code does actually retrieve the values from the file correctly, but after reaching the last one it crashes. It might have to do with the token_iterator i, but I don’t have a clue of what is causing it or how to fix it.
I really forgot about this– I’m pretty sure there was an external problem on this, linker-related, so it was kinda hard to figure out. But the code was fine.