Hi,
I looked at the status page:
http://gcc.gnu.org/gcc-4.7/cxx0x_status.html
and it doesn't mention support for <regex> one way or the other.
I wrote this tiny test program:
////////////////////////////////////////////////////////////
#include <iostream>
#include <regex>
int main()
{
std::string s("ABC def");
std::regex rx("de");
std::cout << std::regex_match(s, rx) << " "
<< std::regex_search(s, rx) << std::endl;
return 0;
}
////////////////////////////////////////////////////////////
Expected output: 0 1
Actual output: 0 0
I built it like this (using my local g++ 4.7 build):
/home/mark/opt/gcc47/bin/g++ -o main.o -c -std=c++11 -pedantic -Wall -
Wextra -lstdc++ -lpthread -L/home/mark/opt/gcc47/lib -L/home/mark/opt/
gcc47/lib64 -ggdb main.cpp
export PATH=/home/mark/opt/gcc47/bin:/usr/bin
export LD_RUN_PATH=/home/mark/opt/gcc47/lib64
/home/mark/opt/gcc47/bin/g++ -o regex_test main.o -std=c++11 -pedantic
-Wall -Wextra -lstdc++ -lpthread -L/home/mark/opt/gcc47/lib -L/home/
mark/opt/gcc47/lib64
There were no warnings or errors and it compiled and ran.
Can anyone tell me what I've done wrong?
Is there some other library I should be linking against?
Thanks!