Boost和标准库中正则表达式的使用
来源:互联网 发布:淘宝店铺水印 编辑:程序博客网 时间:2024/06/05 11:20
#include "ReadShp.h"
#include <regex>
#include "boost/regex.hpp"
int main()
{
//ReadShp sh(StringBase(_T("D:\\IP\\J-圏央道(Rev.0.5.01.01)試作データ\\90202_LNND_SPLIT\\khi_road_vectorLine_FeatureV.shp")));
//ReadShp sh(StringBase(_T("D:\\IP\\J-圏央道(Rev.0.5.01.01)試作データ\\90202_LNND_SPLIT\\R468_1_LNNDT_LLND_LANE_MARK_01.shp")));
//sh.run();
/*
// 正则表达式
// regex_match和regex_search都只匹配一次
// 它们唯一的不同就是前者需要整个字符串完全匹配,后者只部分匹配
StringBase str = _T("111com_310018931@qq.cam_3100.qq.cpm.3100g");
boost::wregex rx(_T("c[a|o|p]m"));
std::wsmatch mst;
StringBase::iterator it_begin = str.begin();
StringBase::iterator it_end = str.end();
std::wsregex_iterator it(it_begin, it_end, rx);
std::wsregex_iterator it_gg;
for (; it != it_gg; ++it)
{
std::wcout<<it->position()<<std::endl;
}
*/
StringBase str = _T("111com_310018931@qq.cam_3100.qq.cpm.3100g");
boost::wregex rx(_T("c[a|o|p]m"));
boost::wsmatch mst;
StringBase::iterator it_begin = str.begin();
StringBase::iterator it_end = str.end();
boost::wsregex_iterator it(it_begin, it_end, rx);
boost::wsregex_iterator it_gg;
for (; it != it_gg; ++it)
{
std::wcout<<it->position()<<std::endl;
}
system("pause");
return 0;
#include <regex>
#include "boost/regex.hpp"
int main()
{
//ReadShp sh(StringBase(_T("D:\\IP\\J-圏央道(Rev.0.5.01.01)試作データ\\90202_LNND_SPLIT\\khi_road_vectorLine_FeatureV.shp")));
//ReadShp sh(StringBase(_T("D:\\IP\\J-圏央道(Rev.0.5.01.01)試作データ\\90202_LNND_SPLIT\\R468_1_LNNDT_LLND_LANE_MARK_01.shp")));
//sh.run();
/*
// 正则表达式
// regex_match和regex_search都只匹配一次
// 它们唯一的不同就是前者需要整个字符串完全匹配,后者只部分匹配
StringBase str = _T("111com_310018931@qq.cam_3100.qq.cpm.3100g");
boost::wregex rx(_T("c[a|o|p]m"));
std::wsmatch mst;
StringBase::iterator it_begin = str.begin();
StringBase::iterator it_end = str.end();
std::wsregex_iterator it(it_begin, it_end, rx);
std::wsregex_iterator it_gg;
for (; it != it_gg; ++it)
{
std::wcout<<it->position()<<std::endl;
}
*/
StringBase str = _T("111com_310018931@qq.cam_3100.qq.cpm.3100g");
boost::wregex rx(_T("c[a|o|p]m"));
boost::wsmatch mst;
StringBase::iterator it_begin = str.begin();
StringBase::iterator it_end = str.end();
boost::wsregex_iterator it(it_begin, it_end, rx);
boost::wsregex_iterator it_gg;
for (; it != it_gg; ++it)
{
std::wcout<<it->position()<<std::endl;
}
system("pause");
return 0;
}
作者: http://blog.csdn.net/lp310018931
1 0
- Boost和标准库中正则表达式的使用
- 在VC中使用正则表达式(boost库)
- VC2008中配置与使用boost库正则表达式
- 在VS2008中使用正则表达式库 Boost.Regex
- VS2008中使用正则表达式库Boost.Regex
- VC中Boost正则表达式使用
- 在VC6中安装BOOST的正则表达式库
- VC2008配置boost库使用正则表达式的步骤
- boost正则表达式的安装和配置
- C++正则表达式处理Boost库使用
- C++正则表达式处理Boost库使用
- boost xpressive库正则表达式使用笔记
- xpressive是boost的正则表达式库
- 使用boost库的正则表达式regex实现从一篇文档中找出所有匹配的字符串
- [教程] C++“准”标准库Boost学习指南(5):正则表达式库 Boost.Regex
- C++“准”标准库Boost学习指南(5):正则表达式库 Boost.Regex
- C++标准库中正则表达式简介
- 在c++Builder中使用boost正则表达式实现的查找double和int类型的字符串,并实现StringToInteger和StringToDouble函数
- 职责链模式
- i++与++i哪个效率更高?
- IAR将变量定义在指定地址
- 关于const与指针混合使用的助记法
- 图形与图像处理的常用的水印算法
- Boost和标准库中正则表达式的使用
- ArcGIS教程:曲率工具的工作原理
- Android Drawable Resource学习(二)、BitmapDrawable和Bitmap
- Docker无法启动 Could not find a free IP address range for interface 'docker0' 最方便的解决办法
- Markdown编辑器使用说明
- hihocoder 1232 || 2015北京网络赛F题 树连剖分
- 静态类、静态变量、静态方法
- Android Drawable Resource学习(三)、NinePatchDrawable和NinePatch图片的制作
- android.view.InflateException