I'm trying to understand the behavior of the following code.
I think it might be a bug since the result looks wrong to me.
#include <iostream>
#include <regex>
int main(int ac, char **av)
{
std::regex reg("lib(.*)\\.so");
std::smatch match;
std::cout << std::regex_match(std::string("libscio.so"), match, reg) << std::endl;
std::cout << match.str(1) << std::endl;
return 0;
}
I'm expecting
1
scio
But it gives me
1
ocio
Compiled with gcc version 4.9.2 (Debian 4.9.2-10) on x86_64 GNU/Linux