VC中使用正则表达式
2008-01-16 10:11
323 查看
到那个网址下载h和cpp文件,包含进工程
http://research.microsoft.com/projects/greta/
#include <iostream>
#include <string>
#include "regexpr2.h"
using namespace std;
using namespace regex;
#pragma warning(disable:4786)
int main() {
match_results results;
string str( "The book cost $12.34" );
rpattern pat( "////$(////d+)(////.(////d////d))?" );
/*
string str( "Javascript" );
rpattern pat( "java(?!script)" ); //rpattern pat( "java(?!script)" ,NOCASE);是不区分大小写
*/
match_results::backref_type br = pat.match( str, results );
if( br.matched ) {
cout << "match success!" << endl;
cout << "price:" << br << endl;
} else {
cout << "match failed!" << endl;
}
return 0;
}
http://research.microsoft.com/projects/greta/
#include <iostream>
#include <string>
#include "regexpr2.h"
using namespace std;
using namespace regex;
#pragma warning(disable:4786)
int main() {
match_results results;
string str( "The book cost $12.34" );
rpattern pat( "////$(////d+)(////.(////d////d))?" );
/*
string str( "Javascript" );
rpattern pat( "java(?!script)" ); //rpattern pat( "java(?!script)" ,NOCASE);是不区分大小写
*/
match_results::backref_type br = pat.match( str, results );
if( br.matched ) {
cout << "match success!" << endl;
cout << "price:" << br << endl;
} else {
cout << "match failed!" << endl;
}
return 0;
}
相关文章推荐
- VC正则表达式的使用
- VC6微软正则表达式greta使用案例
- VC中使用正则表达式
- 在VS2008套装中的VC++环境下使用正则表达式
- VC中使用ATL库实现正则表达式匹配(ADODB::Error)
- 使用 VC 编译 PCRE (PCRE 是一套正则表达式的开源库)
- VC正则表达式的使用
- VC中Boost正则表达式使用
- 在VS2008套装中的VC++环境下使用正则表达式
- VC2010使用正则表达式
- 在VC中使用正则表达式(boost库)
- VC正则表达式的使用
- VC调用vbscript.dll使用其正则表达式库
- 在 Oracle 中使用正则表达式
- Java正则表达式匹配、替换HTML内容[使用Jakarta ORO]
- MySQL中使用正则表达式查询
- IOS使用正则表达式去掉html中的标签元素,获得纯文本
- javascript中的正则表达式的使用
- Mysql语法、特殊符号及正则表达式的使用详解
- 正则表达式,终极使用!3个工具,搞定一切