shootingstars

菩提本无树,明镜亦非台。本来无一物,何处惹尘埃。尘埃乃虚幻,亦何惧之来?

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2007年8月1日

摘要: 七:regex_replace学习写了个去除左侧无效字符(空格,回车,TAB)的正则表达式。Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--std::stringtestString="\r\nHelloWorld!GoodByeWorld\r\n";... 阅读全文
posted @ 2007-08-01 18:45 shootingstars 阅读(1733) 评论(5) 推荐(0) 编辑

摘要: 六:关于重复的贪婪我们先来一个例子:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--std::stringregstr="(.*)(age)(.*)(\\d{2})";boost::regexexpression(regstr);std::string... 阅读全文
posted @ 2007-08-01 17:08 shootingstars 阅读(911) 评论(0) 推荐(0) 编辑

摘要: 五:regex_search学习regex_search与regex_match基本相同,只不过regex_search不要求全部匹配,即部份匹配(查找)即可。简单例子:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--std::stringregstr... 阅读全文
posted @ 2007-08-01 15:12 shootingstars 阅读(1242) 评论(0) 推荐(0) 编辑

摘要: 四:regex_match例子代码学习1 我们经常会看一个字符串是不是合法的IP地址,合法的IP地址需要符合以下这个特征: xxx.xxx.xxx.xxx 其中xxx是不超过255的整数正则表达式找到上面的这种形式的字符串相当容易,只是判断xxx是否超过255就比较困难了(因为正则表达式是处理的文本,而非数字)OK,我们先来处理一个数字,即:xxx。找到一种表达式来处理这个数字,并且保证这个数字不... 阅读全文
posted @ 2007-08-01 11:23 shootingstars 阅读(1022) 评论(0) 推荐(0) 编辑