regular expressions

So I just started playing around with regular expressions, and I quickly ran into some trouble. Here's my code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <tr1/regex>
#include <iostream>
#include <string>

int main()
{
    std::string str = "Hello world";
    std::tr1::regex rx("ello");

    if (regex_match(str.begin(), str.end(), rx))
    {
       std::cout << "WORKS";
    }

    return 0;
}


I get an error on line 8 that says 8 " `std::tr1' has not been declared " and 8 "`regex' undeclared (first use this function)." Could it be that my compiler does not support TR1?
Try hesder<regex>
i included hesder<regex> in the header and i got the same errors along with " #include expects "FILENAME" or <FILENAME> " for the first line.
Topic archived. No new replies allowed.