First of all I would like to apologize for my english.
I'm working in a small C++ project and I would like to keep it small. Main problem is I need to use regex, but they don't work the way I need.
This works fine:
std::string s ("subject");
std::regex e ("(sub)(.*)");
if (std::regex_match (s,e))
std::cout << "string object matched\n";
This one works fine too:
std::string s ("0");
std::regex e ("[0-9]", std::regex::extended);
if (std::regex_match (s,e))
std::cout << "string object matched\n";
Even if I change std::regex::extended for std::regex::awk, basic or whatever this code doesn't work:
std::string s ("00");
std::regex e ("[0-9]{2}", std::regex::extended);
if (std::regex_match (s,e))
std::cout << "string object matched\n";
Am I doing anything wrong?
I know std::regex aren't finished but I think they should work in such a simple regular expresion.
Anyway if anyone can point me a small regex library (not boost please) I will be thankfull.
ADITIONAL INFO
I'm working on Linux Ubuntu 12.10, compiler is gcc > 4.7
Edit:
@jalf: It compiles but it gives me a wrong result in the last one. It gives an error. Can't show any result cos I'm in a client today and I have no access to the program.
@KennyTM: Yes it's gcc/libstdc++ again, I have been reading this forums looking for an answer. Again, I can't use boost.
@Pete Becker: Yes, it's gcc > 4.7 version. Can't remember the exact version.