vc6可利用boost库使用正则表达式。支持vc6的最高boost版本是1.34.1。很多人编译boost库遇到这样那样的问题。这个是我编译好的库,直接解压后,在vc中设置好include和lib路径即可使用。
测试程序:
#include
#include
#include
#include
#include
using namespace std;
using namespace boost;
int main( int argc, char * argv[])
{
regex expression_r_r_r_r( " (\d+)-(\d+)-(\d+) " ); // 注意转义方式
string in ( " Today: 2007-06-23 " );
cmatch what;
// 如果用 regex_match 方法将需要完全匹配,
// 不能在字符串中找寻模式,可用于验证输入
if (regex_search( in.c_str(), what, expression_r_r_r_r))
{
for ( int i = 0 ;i < what.size();i ++ )
{
cout << " str : [" << what[i].str() << "]" << endl;
}
}
return 0 ;
}
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 392 2005-10-19 09:40 Boostincludeoost-1_34_1oost r1 r1cc32array.h
文件 3979 2006-09-20 15:49 Boostincludeoost-1_34_1oostpythondetailpython22_fixed.h
文件 395 2005-10-19 09:40 Boostincludeoost-1_34_1oost r1 r1cc32
andom.h
文件 392 2005-10-19 09:40 Boostincludeoost-1_34_1oost r1 r1cc32
egex.h
文件 2274 2004-09-29 03:22 Boostincludeoost-1_34_1oost
egex.h
文件 392 2005-10-19 09:40 Boostincludeoost-1_34_1oost r1 r1cc32 uple.h
文件 410 2005-10-19 09:40 Boostincludeoost-1_34_1oost r1 r1cc32 ype_tra.h
文件 607 2005-01-27 09:49 Boostincludeoost-1_34_1oostarchivedetailabi_prefix.hpp
文件 657 2003-11-25 11:28 Boostincludeoost-1_34_1oostconfigabi_prefix.hpp
文件 558 2005-01-27 09:49 Boostincludeoost-1_34_1oostarchivedetailabi_suffix.hpp
文件 744 2003-11-25 11:28 Boostincludeoost-1_34_1oostconfigabi_suffix.hpp
文件 1579 2004-09-02 08:41 Boostincludeoost-1_34_1oostspiritfusiondetailaccess.hpp
文件 3505 2005-11-26 10:12 Boostincludeoost-1_34_1oostxpressivedetailcoreaccess.hpp
文件 3875 2005-07-10 18:35 Boostincludeoost-1_34_1oostserializationaccess.hpp
文件 2945 2005-04-11 08:03 Boostincludeoost-1_34_1oostiostreamsdetailaccess_control.hpp
文件 2226 2006-10-16 10:40 Boostincludeoost-1_34_1oostmulti_indexdetailaccess_specifier.hpp
文件 1067 2005-01-19 08:20 Boostincludeoost-1_34_1oostmplaccumulate.hpp
文件 7626 2006-07-24 14:33 Boostincludeoost-1_34_1oostmathcomplexacos.hpp
文件 1070 2005-10-15 04:59 Boostincludeoost-1_34_1oostmathcomplexacosh.hpp
文件 6338 2004-08-19 08:19 Boostincludeoost-1_34_1oostmathspecial_functionsacosh.hpp
文件 1657 2005-11-26 10:12 Boostincludeoost-1_34_1oostxpressivedetailcoreaction.hpp
文件 2320 2005-11-26 10:12 Boostincludeoost-1_34_1oostxpressivedetailcorematcheraction_matcher.hpp
文件 2066 2005-11-26 10:12 Boostincludeoost-1_34_1oostxpressivedetailcoreaction_state.hpp
文件 4780 2004-07-09 01:28 Boostincludeoost-1_34_1oostspiritcorecompositeactions.hpp
文件 5766 2004-07-26 20:43 Boostincludeoost-1_34_1oostlambdadetailactions.hpp
文件 5264 2004-09-13 02:20 Boostincludeoost-1_34_1oostspiritactor.hpp
文件 19684 2005-01-28 04:59 Boostincludeoost-1_34_1oostspiritphoenixactor.hpp
文件 1343 2005-02-16 11:01 Boostincludeoost-1_34_1oostspiritfusioniteratordetailadapt_deref_traits.hpp
文件 863 2004-07-17 12:48 Boostincludeoost-1_34_1oostspiritfusioniteratordetailadapt_value_traits.hpp
文件 2244 2005-11-26 10:12 Boostincludeoost-1_34_1oostxpressivedetailcoreadaptor.hpp
............此处省略4233个文件信息
// (C) Copyright Gennadiy Rozental 2005.
// Use modification and distribution are subject to the
// Boost Software License Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//
// File : $RCSfile: argv_traverser.cppv $
//
// Version : $Revision: 1.1 $
//
// Description : offline implementation for argc/argv traverser
// ***************************************************************************
#define BOOST_RT_PARAM_INLINE
#include
// ************************************************************************** //
// Revision History:
//
// $Log: argv_traverser.cppv $
// Revision 1.1 2005/04/12 06:42:42 rogeeff
// Runtime.Param library initial commit
//
// ************************************************************************** //
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 392 2005-10-19 09:40 Boostincludeoost-1_34_1oost r1 r1cc32array.h
文件 3979 2006-09-20 15:49 Boostincludeoost-1_34_1oostpythondetailpython22_fixed.h
文件 395 2005-10-19 09:40 Boostincludeoost-1_34_1oost r1 r1cc32
andom.h
文件 392 2005-10-19 09:40 Boostincludeoost-1_34_1oost r1 r1cc32
egex.h
文件 2274 2004-09-29 03:22 Boostincludeoost-1_34_1oost
egex.h
文件 392 2005-10-19 09:40 Boostincludeoost-1_34_1oost r1 r1cc32 uple.h
文件 410 2005-10-19 09:40 Boostincludeoost-1_34_1oost r1 r1cc32 ype_tra.h
文件 607 2005-01-27 09:49 Boostincludeoost-1_34_1oostarchivedetailabi_prefix.hpp
文件 657 2003-11-25 11:28 Boostincludeoost-1_34_1oostconfigabi_prefix.hpp
文件 558 2005-01-27 09:49 Boostincludeoost-1_34_1oostarchivedetailabi_suffix.hpp
文件 744 2003-11-25 11:28 Boostincludeoost-1_34_1oostconfigabi_suffix.hpp
文件 1579 2004-09-02 08:41 Boostincludeoost-1_34_1oostspiritfusiondetailaccess.hpp
文件 3505 2005-11-26 10:12 Boostincludeoost-1_34_1oostxpressivedetailcoreaccess.hpp
文件 3875 2005-07-10 18:35 Boostincludeoost-1_34_1oostserializationaccess.hpp
文件 2945 2005-04-11 08:03 Boostincludeoost-1_34_1oostiostreamsdetailaccess_control.hpp
文件 2226 2006-10-16 10:40 Boostincludeoost-1_34_1oostmulti_indexdetailaccess_specifier.hpp
文件 1067 2005-01-19 08:20 Boostincludeoost-1_34_1oostmplaccumulate.hpp
文件 7626 2006-07-24 14:33 Boostincludeoost-1_34_1oostmathcomplexacos.hpp
文件 1070 2005-10-15 04:59 Boostincludeoost-1_34_1oostmathcomplexacosh.hpp
文件 6338 2004-08-19 08:19 Boostincludeoost-1_34_1oostmathspecial_functionsacosh.hpp
文件 1657 2005-11-26 10:12 Boostincludeoost-1_34_1oostxpressivedetailcoreaction.hpp
文件 2320 2005-11-26 10:12 Boostincludeoost-1_34_1oostxpressivedetailcorematcheraction_matcher.hpp
文件 2066 2005-11-26 10:12 Boostincludeoost-1_34_1oostxpressivedetailcoreaction_state.hpp
文件 4780 2004-07-09 01:28 Boostincludeoost-1_34_1oostspiritcorecompositeactions.hpp
文件 5766 2004-07-26 20:43 Boostincludeoost-1_34_1oostlambdadetailactions.hpp
文件 5264 2004-09-13 02:20 Boostincludeoost-1_34_1oostspiritactor.hpp
文件 19684 2005-01-28 04:59 Boostincludeoost-1_34_1oostspiritphoenixactor.hpp
文件 1343 2005-02-16 11:01 Boostincludeoost-1_34_1oostspiritfusioniteratordetailadapt_deref_traits.hpp
文件 863 2004-07-17 12:48 Boostincludeoost-1_34_1oostspiritfusioniteratordetailadapt_value_traits.hpp
文件 2244 2005-11-26 10:12 Boostincludeoost-1_34_1oostxpressivedetailcoreadaptor.hpp
............此处省略4233个文件信息
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)