Originally Posted by
KenLP
Is there anyone familiar with this who can help walk me through the process of setting up PCRE 8.12 with MinGW and Visual Studio?
Alternately, if a good guide exists, you can just point me in the right direction. But so far, I haven't been able to find anything appropriate.
The compiler that comes with Visual Studio 2010 comes with the TR1 extensions to the standard library, including the regular expressions library. The functionality provided by <regex>, which is soon to be included in the C++ standard, to be ratified later this year. A quick search brings up this tutorial on Getting started with C++ TR1 regular expressions, and you should be able to test with this program:
Code:
#include <iostream>
#include <regex>
#include <string>
int main()
{
using namespace std;
string str = "Hello world";
tr1::regex rx("ello");
if (regex_match(str.begin(), str.end(), rx))
{
cout << "Match" << endl;
}
else
{
cout << "No match" << endl;
}
if (regex_search(str.begin(), str.end(), rx))
{
cout << "Found" << endl;
}
else
{
cout << "Not found" << endl;
}
}