visual studio 2005 下安装使用boost库 (正则表达式)
2011-05-08 21:42
387 查看
下载boost最新库
安装:
1、打开vs2005在菜单tools中选择Visual Studio 2005 Command
Prompt,打开已配置好环境的命令行。
2、进入目录boost_1_34_1/libs/regex/build,
编译文件:nmake
-f vc8.mak
安装(将编译好的文件复制到vs2005的特定目录下):nmake -f vc8.mak
install
删除临时文件:nmake -f vc8.mak clean
3、Tools->Options->Projects
and Solutions->VC++ Directories->Include files添加boost_1_34_1路径
在vs2005中编写如下代码
在提示下输入
enter test string
select name from table
得到如下结果,具体为什么自己认真分析
str :select name from table
str
:name
str :table
转载请标明出处:http://jinyun2012.blog.sohu.com/155691639.html
安装:
1、打开vs2005在菜单tools中选择Visual Studio 2005 Command
Prompt,打开已配置好环境的命令行。
2、进入目录boost_1_34_1/libs/regex/build,
编译文件:nmake
-f vc8.mak
安装(将编译好的文件复制到vs2005的特定目录下):nmake -f vc8.mak
install
删除临时文件:nmake -f vc8.mak clean
3、Tools->Options->Projects
and Solutions->VC++ Directories->Include files添加boost_1_34_1路径
在vs2005中编写如下代码
#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 test string
select name from table
得到如下结果,具体为什么自己认真分析
str :select name from table
str
:name
str :table
转载请标明出处:http://jinyun2012.blog.sohu.com/155691639.html
相关文章推荐
- BOOST 正则表达式 在Visual Studio 2005 下(VC8)的安装
- [转]BOOST 正则表达式 在Visual Studio 2005 下(VC8)的安装
- 在 Visual Studio 或 SQLServer Management Studio 的代码编辑器中使用正则表达式匹配日期格式
- SQL Server 2005 里使用正则表达式的方法
- Visual Studio中使用正则表达式进行代码规范的检查
- 使用boost库的正则表达式regex实现从一篇文档中找出所有匹配的字符串
- C++正则表达式处理Boost库使用
- 在Visual Studio中使用正则表达式匹配换行和批量替换
- Visual Studio 使用正则表达式查找替换
- Visual Studio里使用正则表达式进行查找与替换
- 如何在Visual Studio的查找功能中使用正则表达式?
- Visual Studio中使用正则表达式进行代码规范的检查
- 在Visual Studio的替换窗口使用正则表达式分组是使用花括号,而不是小括号
- visual studio 2005 安装Ajax控件及使用
- 使用visual studio的正则表达式替换功能
- VC2008中配置与使用boost库正则表达式
- SQL Server 2005 中使用正则表达式匹配
- visual c#2005中使用正则表达式
- 在VC中使用正则表达式(boost库)
- 在SQL Server 2005中使用正则表达式