ChinaUnix.net
相关文章推荐:

pcre 例子

例子1: #include stdio.h> #include string.h> #include pcre.h> /********************************************************************** *#include * *parameters: src: string * * pattern: regular expression * *return: match >= 0 and nomatch int fun_ismatch( char* src, char* pattern) { pcre *re; const char *error; int erroffset; int rc; if( (re = pcre_compile...

by 大隐隐于床 - Linux文档专区 - 2009-04-18 20:54:24 阅读(1964) 回复(0)

相关讨论

如题,求助:如何pcre正则表达式库移植到linux内核呢????

by anjing83830 - 内核源码 - 2011-05-27 21:29:06 阅读(1786) 回复(2)

本帖最后由 FightForWin 于 2011-03-11 14:13 编辑 大家好:我要在字符串中匹配 /abc? eev= 这两个串。 源串可能的形式为 GET /abc?eev=http://txt? 或 GET /abc?xx=yy&eev=htp://txt? 其实就是除了要匹配 /abc? 外还要匹配 eev= 其中eev前面要么没有其他字符,如GET /abc?eev=http://txt? 要么是取地址符,如GET /abc?xx=yy&eev=htp://txt? 请教大家,怎么写正则表达式,谢谢。 编辑原因:一开始把字符串弄错了,不好意...

by FightForWin - Perl - 2011-03-11 14:27:47 阅读(3379) 回复(6)

我把文件上传到tmp,然后执行[code] tar -zxvf pcre-8.33.tar.gz cd pcre-8.33 ./configure make && make install [/code]有三个疑问,安装完,是否可以删除tmp/pcre-8.33的文件夹 【不同这一点和windows有何不同】 第二,安装完之后,pcre是跑到哪个目录了 第三,如果要卸载,如何卸

by eremiter - Linux新手园地 - 2014-01-26 09:23:23 阅读(1182) 回复(2)

没看懂下句的意思,网上只说?是启用扩展匹配,没找到详细的说明,哪位大侠给个链接? preg_match_all('/(?:^|\s)#([\pL\pN_\-\.]{1,64})/u'

by lsstarboy - PHP - 2010-03-15 16:21:16 阅读(1590) 回复(2)

不明白为什么使用pcre 6.4会提示下面这种错误 [quote] g++ -I/home/down/pcre-6.4/ -I/home/ext/pcre/include/ -I./ -L/home/ext/pcre/lib/ -lpcre re.cpp rg.cpp -o rg re.cpp: In member function `const Regexp& Regexp::operator=(const std::string&)': re.cpp:53: error: invalid use of undefined type `struct real_pcre' /home/down/pcre-6.4/pcre.h:164: error: forward declaration of `struct real_pcre' re.cpp: In ...

by tsinghyT - C/C++ - 2006-02-01 20:08:05 阅读(959) 回复(0)

302 pcre *re; 303 const char *error; 304 int erroffset; 305 int rc; 306 char pattern[KRK_MAX_HTTP_EXPECTED+1] = {0,}; 307 308 memcpy(pattern, hcp->expected, hcp->expected_len); 309 310 re = pcre_compile(pattern, pcre_CASELESS, &error, &erroffset, NULL); 311 if (re == NULL) { 312 fprintf(stderr,"compile pcre failed\n"); 313 return KRK_ERROR; 314 ...

by 316953425 - C/C++ - 2014-08-27 12:54:00 阅读(1317) 回复(4)

302 pcre *re; 303 const char *error; 304 int erroffset; 305 int rc; 306 char pattern[KRK_MAX_HTTP_EXPECTED+1] = {0,}; 307 308 memcpy(pattern, hcp->expected, hcp->expected_len); 309 310 re = pcre_compile(pattern, pcre_CASELESS, &error, &erroffset, NULL); 311 if (re == NULL) { 312 fprintf(stderr,"compile pcre failed\n"); 313 return KRK_ERROR; 314 ...

by 316953425 - C/C++ - 2014-08-19 16:13:40 阅读(659) 回复(0)

[code]/* * g++ pcre2.cpp -I/usr/local/include -L/usr/local/lib -R/usr/local/lib -lpcre++ -lpcre */ #include #include #include <pcre++.h> using namespace std; using namespace pcrepp; int main() { string src("111 Hello World 222"); string pattern("(.*)"); cout << "String : " << src << endl; cout << "Pattern : " <<...

by 八月飞霜 - C/C++ - 2013-04-23 09:37:46 阅读(1569) 回复(2)

Ubuntu 12.04 LTS 通过apt-get install libpcre3 libpcre3-dev安装pcre,安装后,pcre.h在/usr/include/pcre.h 程序中,#include <pcre.h> gcc -Wall -I/usr/include -I/usr/local/include -L/lib -L/usr/lib -L/usr/local/lib -lpcre 5.c,有如下提示: 5.c:(.text+0x54): undefined reference to `pcre_compile' 5.c:(.text+0x7d): undefined reference to `pcre_study' 5.c:(.text+0xf2): undefined reference to `pcre_exec...

by i33333 - C/C++ - 2012-08-14 09:20:56 阅读(4128) 回复(4)

比如源字符串: char src [] = "111 Hello World 222nihao"; 正则表达式: char pattern [] = "(.*)</(tit)le>"; 我想匹配Hello World和nihao ,perl可以使用g参数来匹配多次,使用<font color="red">pcre</font>要怎么做? char pattern [] = "<title>(.*)</(tit)le>.*<title>(.*)</(tit)le>";这样的表达式就不用了。 </p> <p class="news_tag"> </p> </div> <div class="two_con2"> by <a href="http://bbs.chinaunix.net/space-uid-20748054.html" target="_blank">qfmeal </a> - <a href="http://bbs.chinaunix.net/forum-23-1.html" target="_blank">C/C++</a> - 2011-06-08 18:11:50 阅读(2522) 回复(0) </div> </div> <div class="friendly_link"> <div class="friendly_con1"> <div class="f_link_tit">盛拓传媒:</div> <p><a href="http://www.it168.com">IT168</a> | <a href="http://www.pcpop.com">泡泡网</a> | <a href="http://www.autohome.com.cn">汽车之家</a> | <a href="http://www.che168.com">二手车之家</a> | <a href="http://www.qudao168.com">渠道168</a> | <a href="http://www.itpub.net/">ITPUB</a> | <a href="http://www.ixpub.net/">IXPUB</a> | <a href="http://www.chinaunix.net/">ChinaUnix</a> | <a href=" http://www.jimi168.com/">安卓之家</a> | <a href="http://www.app111.com/">苹果园</a> | <a href="http://www.gqt168.com/">家商城</a> | <a href="http://bbs.app111.com/">苹果论坛</a></p> <div class="clear"></div> </div> </div> <div id="footer"> <div class="dot1"><a href="http://www.bj.cyberpolice.cn/index.jsp" class="n1"></a><a href="http://www.hd315.gov.cn/beian/view.asp?bianhao=010202008062400006"></a><a href="http://ulic.baidu.com/client/clientDetailCerInfo.do?id=1602"></a></div> <p class="p"> <a href="http://www.it168.com/bottomfile/about.shtml" rel="nofollow">盛拓传媒简介</a> | <a href="http://www.it168.com/bottomfile/it168.shtml" rel="nofollow">关于IT168</a> | <a href="http://www.it168.com/bottomfile/hzhb.shtml" rel="nofollow">合作伙伴</a> | <a href="http://www.it168.com/bottomfile/ggfw.shtml" rel="nofollow">广告服务</a> | <a href="http://www.it168.com/bottomfile/sytk.shtml" rel="nofollow">使用条款</a> | <a href="http://www.it168.com/bottomfile/tgzn.shtml" rel="nofollow">投稿指南</a> | <a href="http://www.wintalent.cn:8031/wt5/sequelmedia/web/index" rel="nofollow">诚聘精英</a> | <a href="http://www.it168.com/bottomfile/lxwm.shtml" rel="nofollow">联系我们</a> | <a href="http://www.itpub.net/forum.php">ITPUB论坛</a> | <a href="http://www.it168.com/bottomfile/sitemap/sitemap.html" rel="nofollow">网站导航</a> | <a href="http://archive.it168.com/" rel="nofollow">往日回顾</a> </p> <address> 北京皓辰网域网络信息技术有限公司. 版权所有 <a href="http://www.it168.com/images/icp.jpg"><font color="#666666">京ICP证:060528号</font></a> 北京市公安局海淀分局网监中心备案编号:1101082001<br> <font color="#666666">广播电视节目制作经营许可证:编号(京)字第1149号</font> </address> <div style=" color:#666;margin-top:10px; text-align:right;">ITPUB推荐文章解答你所有技术难题</div> <div class="clear"> </div> </div> </div> <!-- 统计 START --> <script language="javascript" src="http://stat.it168.com/pv.js"></script> <script> function sendPV(){ var pvTrack = new PvTrack(); pvTrack.type = 35; // 频道类别ID pvTrack.channel = 461; // 频道ID pvTrack.pageType = 0; pvTrack.track(); } window.setTimeout("sendPV()", 1000); </script> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-20237423-2']); _gaq.push(['_setDomainName', '.chinaunix.net']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> <div style='display:none'> <script type="text/javascript"> var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://"); document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F0ee5e8cdc4d43389b3d1bfd76e83216b' type='text/javascript'%3E%3C/script%3E")); </script></div> <!-- END STAT PV --> <!-- <script type='text/javascript' src='http://168.it168.com/js/597.js'></script> --> <script>if(typeof(BLA)!='undefined'){BLA();}</script> </body> </html>