boost.xpressive
来源:互联网 发布:hf系统线切割怎么编程 编辑:程序博客网 时间:2024/05/22 12:31
//made by davidsu33
//2014-6-11
#include <boost/config/warning_disable.hpp>
#include <QtCore/QCoreApplication>
#include <boost/xpressive/xpressive_dynamic.hpp>
#include <boost/xpressive/xpressive_static.hpp>
#include <boost/typeof/typeof.hpp>
void use_dynamic_xpressive()
{
std::string srx("^\\w{2}.?(x|y)z{3}$");
boost::xpressive::sregex rx1 =
boost::xpressive::sregex::compile(srx);
std::string s = "a1.yzzz";
std::string s2 = "axxx";
std::string s3 = "a1.YYY";
boost::xpressive::smatch macher1;
bool b1 = boost::xpressive::regex_match(s.begin(), s.end(), macher1, rx1);
int mSize = macher1.size();
std::string str1 = macher1.str(0);
std::string str2 = macher1.str(1);
int pos1 = macher1.position(0);
int pos2 = macher1.position(1);
for (BOOST_AUTO(it , macher1.begin()); it != macher1.end(); ++it)
{
std::cout<<*it<<std::endl;
}
bool b2 = boost::xpressive::regex_match(s2.begin(), s2.end(), rx1);
bool b3 = boost::xpressive::regex_match(s3.begin(), s3.end(), rx1);
bool b4 = boost::xpressive::regex_match(s3.begin(), s3.end(), rx1);
boost::xpressive::sregex rx2 =
boost::xpressive::sregex::compile(srx, boost::xpressive::icase);
bool b5 = boost::xpressive::regex_match(s3.begin(), s3.end(), rx2);
int xx = 0;
}
void use_static_xpressive()
{
}
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
use_dynamic_xpressive();
return a.exec();
}
//2014-6-11
#include <boost/config/warning_disable.hpp>
#include <QtCore/QCoreApplication>
#include <boost/xpressive/xpressive_dynamic.hpp>
#include <boost/xpressive/xpressive_static.hpp>
#include <boost/typeof/typeof.hpp>
void use_dynamic_xpressive()
{
std::string srx("^\\w{2}.?(x|y)z{3}$");
boost::xpressive::sregex rx1 =
boost::xpressive::sregex::compile(srx);
std::string s = "a1.yzzz";
std::string s2 = "axxx";
std::string s3 = "a1.YYY";
boost::xpressive::smatch macher1;
bool b1 = boost::xpressive::regex_match(s.begin(), s.end(), macher1, rx1);
int mSize = macher1.size();
std::string str1 = macher1.str(0);
std::string str2 = macher1.str(1);
int pos1 = macher1.position(0);
int pos2 = macher1.position(1);
for (BOOST_AUTO(it , macher1.begin()); it != macher1.end(); ++it)
{
std::cout<<*it<<std::endl;
}
bool b2 = boost::xpressive::regex_match(s2.begin(), s2.end(), rx1);
bool b3 = boost::xpressive::regex_match(s3.begin(), s3.end(), rx1);
bool b4 = boost::xpressive::regex_match(s3.begin(), s3.end(), rx1);
boost::xpressive::sregex rx2 =
boost::xpressive::sregex::compile(srx, boost::xpressive::icase);
bool b5 = boost::xpressive::regex_match(s3.begin(), s3.end(), rx2);
int xx = 0;
}
void use_static_xpressive()
{
}
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
use_dynamic_xpressive();
return a.exec();
}
0 0
- boost xpressive
- boost.xpressive
- boost xpressive
- boost xpressive 例子
- boost xpressive简明用法
- Boost xpressive 正则表达式
- boost xpressive的用法1
- boost.xpressive,Formatter的用法
- boost的xpressive编译错误如何解决?
- boost的xpressive的正则表达式
- Boost 使用xpressive正则表达式错误
- boost xpressive库和string_algo库
- xpressive是boost的正则表达式库
- boost xpressive库正则表达式使用笔记
- Performance: std::regex v.s. boost::regex v.s. boost::xpressive v.s. boost::spirit::qi
- boost正则表达式库regex库和xpressive库关于零宽断言的问题
- boost xpressive库,介于正则和bnf库之间的混血。显示c/c++代码注释部分。
- 关于boost的regex库和xpressive库匹配所有标点(含中文标点)的方法
- 什么是分布式系统
- ViewPart和EditorPart之间的通讯
- 中国软件杯-简易新闻发布端(Android XML分析)
- 第二次实验:QuickSort快速排序
- Swift 学习笔记之基础
- boost.xpressive
- 设计模式-单例模式
- C++回顾之深浅拷贝、禁止拷贝、空类的默认成员
- lua,python,c++
- Python局部变量、对象的理解
- 编程愚蠢错误~~~~~~~~~~~
- Lua栈介绍以及实例
- 小菜的c++学习之路~~
- fastjson 使用方法