Is there any native library in STL which is tested and works without any extra compiler options?
I tried to use , but the compiler outputs this:
G++ 4.3 (and presumably later versions as well) is just being careful about the header files for maximum standards conformance.
If you're programming in C++98 (the current standard that's been around for a while), then regular expression support was added in tech report 1, and the and the header files are in a special tr1 directory, and the contents are in a special namespace std::tr1.
In the new C++0x standard, the regular expression support has been merged into the standard library, so it can be found in the header regex and namespace std.
G++ makes sure that you use the right version for the --std= version you specified on the command line, even though internally they're both the same implementation.
So to make regex work without switching to --std=c++0x, just
#include