ChinaUnix.net
相关文章推荐:

boost regex 中文

boost::regex是个好东西,提供了以很好的字符处理与识别的工具包。可是在识别中文的时候,好像总是识别不出来。 很多人在bolg里边也提到,可以用转换字符为UNICODE的方法解决,但是我在我的Linux环境下就是没法识别,痛苦之至阿。 那位仁兄有比较好的解决方法,略指点一二了!谢过。 从网上看的一篇帖子,估计是windows环境下的 http://blog.csdn.net/K_M_Cao/archive/2007/11/07/1871065.aspx 我的环境为Linux CentOS 5.2 boo...

by cnhome_2008 - C/C++ - 2009-08-18 15:56:43 阅读(1093) 回复(1)

相关讨论

单独编译了regex,生成了libboost_regex-gcc-1_34.a,现在试验regex能否生效,代码如下: [code] #include<boost/regex.hpp> int main(int argc,char * argv[]) { boost::regex e("test"); return 0; } [/code] #g++ regex.cpp -I /path/to/boostroot -L/path/to/libboost_regex-gcc-1_34.a -o regex 报错: /tmp/ccf4WLI8.o(.gnu.linkonce.t._ZN5boost11basic_regexIcNS_12regex_traitsIcNS_16cpp_regex_traits...

by terry8416 - C/C++ - 2007-12-29 14:27:47 阅读(3666) 回复(7)

偶翻译的boost.Random中文文档(见附件),有兴趣的可以看看。boost.Random已进入TR1,因此在下次标准库的发布中应该会出现。 该库主要是提供了一些随机数发生器(主要是伪随机数)和各种分布函数,这对于做系统仿真的朋友应该非常有用。 该库也提供了一个Linux下可用的非确定性随机数发生器,这对于涉及安全的项目是很有用的。 翻译过程中发现这个文档写得不太认真,因此你有时得去查看头文件了:mrgreen: (对了,该库是以头文件方...

by tyc611 - C/C++ - 2008-06-21 16:48:36 阅读(4056) 回复(0)

代码如下: 1 #include <boost/regex.hpp> 2 #include 3 4 using namespace std; 5 6 7 int main(void) 8 { 9 boost::regex reg("test"); 10 11 bool b = boost::regex_match("A test string", reg); 12 13 if (b) { 14 cout<<"Success"<

by zijian1984 - C/C++ - 2009-02-22 16:53:22 阅读(1253) 回复(1)

下载后源码用Easy Build and Install ./configure --prefix=/usr/local/ --without-icu 之后抄了个文档的上一个例子,编译链接都没有问题,运行后直接出现 Segmentation fault 我用的系统是 Fedora core 7 gcc-4.1.2 [ 本帖最后由 helor 于 2007-10-25 12:54 编辑 ]

by helor - C/C++ - 2007-10-26 08:29:12 阅读(2487) 回复(4)

我是不是可以直接 [code] boost::regex expression("^中x文 ([a-zA-Z]*) from (.*)"); boost::cmatch what; if(boost::regex_match("中x文 name from 中x文可以啊",what,expression)) { for(int i=0;i中文,是在哪里不支持的?

by z33 - C/C++ - 2006-11-21 21:00:02 阅读(963) 回复(1)

转自:http://www.allaboutprogram.com/about2074.html boost::bind的文档,在http://boost.allaboutprogram.com/libs/bind/bind.html [code]#include ; #include <boost/bind.hpp>; #include <boost/bind/apply.hpp>; using namespace std; int add( int i, int j ) { return i + j; } int add_and_subtract( int i, int j, int k ) { return i + j - k; } int pass( int& i ) { i = 1; ...

by 我不懂C++ - C/C++ - 2004-07-11 22:51:55 阅读(782) 回复(0)

我的系统是fedora 8,boost库是系统自带的,Kdevelop也是系统自带的。 在Kdevelop中建立“简单Hello World”工程,并修改源代码为如下所示: #ifdef HAVE_CONFIG_H #include #endif #include #include #include "boost/regex.hpp" #include #include using namespace std; using namespace boost; int main ( int argc, char *argv[] ) { // 3 digits, a word, any charact...

by flashboy84 - C/C++ - 2008-06-19 16:33:02 阅读(880) 回复(1)

看完了这篇文章http://www.kingofcoder.com/viewNews.php?type=newsCpp&id=85 之後在我的ubuntu 7.04上编译boost, 有这些问题 1) 找不到boost库的.a文件 2) 头文件好像不整, 那下呀?

by koc2 - C/C++ - 2007-06-29 20:19:47 阅读(1133) 回复(4)

my $line = "abcde"; $line =~ s/x?/!/g; 结果为什么会是!a!b!c!d!e! x?又不是zero-width assertion,难道还能匹配位置?

by iLRainyday - Perl - 2009-07-28 11:41:15 阅读(1135) 回复(6)

Oh, I haven’t come here for two weeks. What I am busy with is coding. I should complete all the coding tasks. Bad luck! I must code day after day until the code is over. I’ll recall the problems I encountered those days, and record here to share with all of you. Ok, let’s discuss the problems start with regex (Regular Expression). The following explanation to define the regular expression is...

by heavenflying - Java文档中心 - 2007-09-13 18:29:22 阅读(319) 回复(0)