Click the following code to knock on the line:
cmd
vcvars32.bat
CD D:\boost_1_32_0\libs\regex\build
D:
nmake-fvc6.mak< br> Nmake-fvc6.mak Install
Note, do not download down the packet is not much, after the decompression reached more than 100 m, after compiling 109M, Occupy 131M, so the installation must pay attention to empty out enough space, typing NMAKE-FVC After 6.mak wait longer, there will be a lot of English on the screen, can not be considered. Follow the steps to knock on the line. Compress the documents in the package in detail, and refer to the documentation to continue.
Integrated in VC6: Tools->options->directories->include files
Join: D:\boost_1_32_0
Write a source program test :
#include "stdafx.h" #include <cstdlib> #include <stdlib.h> #include <boost/regex.hpp> #include <string> #include <iostream>
using namespace Std; using namespace boost;
Regex expression ("^select" ([a-za-z]*) from ([a-za-z]*));
int main (int argc, char* argv[]) { Std::string in; Cmatch what; cout << "Enter test string" << Endl; Getline (Cin,in); if (Regex_match (In.c_str (), what, expression)) { for (int i=0;i<what.size (); i++) cout<< "str:" <<what[i].str () <<endl; } Else { cout<< "Error Input" <<endl; } return 0; } |
Enter: Select name from table
Output: Str:select name from table
Str:name
Str:table