当前位置: 首页 > news >正文

做一个舌尖上的中国网站怎么做百度认证平台

做一个舌尖上的中国网站怎么做,百度认证平台,成全视频高清免费观看好听的歌,asp.net mvc 企业网站由于C语言的正则表达式API相对比较简易.默认API只有regcomp/regerror/regexec/regfree这些函数.相对于其他的高级语言中正则表达式所所能实现的功能(如:查找/替换)有所欠缺.所以想着自己写下一些需要的函数以备后续需要使用. #ifndef _E_REGEX_INCLUDE #define _E_REGEX_INCLU…

由于C语言的正则表达式API相对比较简易.默认API只有regcomp/regerror/regexec/regfree这些函数.相对于其他的高级语言中正则表达式所所能实现的功能(如:查找/替换)有所欠缺.所以想着自己写下一些需要的函数以备后续需要使用.

#ifndef _E_REGEX_INCLUDE
#define _E_REGEX_INCLUDE
#include <regex.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>typedef int errno_t;static size_t position = 0;//functions prototype
char* regnext(regex_t* regex,char* content);
void _r_release(void);
bool regreplace(regex_t* regex,char** content,char* replacement);
void regreplaceAll(regex_t* regex,char** content,char* replacement);int main(void){char* content = (char*)"sjdlf12323ldjslfjsjf133334";char* pattern = (char*)"([[:digit:]][[:digit:]])\\1";regex_t regex;errno_t state = regcomp(&regex,pattern,REG_EXTENDED);if(state){char* errbuf = calloc(20,sizeof(char));regerror(state,&regex,errbuf,20);fprintf(stderr,"Regex:%s compile failed.\n""Reason: %s\n",pattern,errbuf);free(errbuf);regfree(&regex);exit(EXIT_FAILURE);}printf("content: %s\n",content);char* replacement = (char*)"";regreplaceAll(&regex,&content,replacement);printf("content: %s\n",content);regfree(&regex);
}//find next match
char* regnext(regex_t* regex,char* content){regmatch_t matches[regex->re_nsub + 1];errno_t state = regexec(regex,content,regex->re_nsub + 1,matches,0);if(state == REG_NOMATCH){_r_release();return NULL;}char* reval = (char*)calloc(matches[0].rm_eo - matches[0].rm_so + 1,sizeof(char));memcpy(reval,content + position + matches[0].rm_so,matches[0].rm_eo - matches[0].rm_so);position += matches[0].rm_eo;return reval;
}//replace first
bool regreplace(regex_t* regex,char** content,char* replacement){regmatch_t matches[regex->re_nsub + 1];errno_t state = regexec(regex,*content,regex->re_nsub + 1,matches,0);if(state == REG_NOMATCH){return false;}char* newContent = (char*)calloc(strlen(*content) + strlen(replacement) - (matches[0].rm_eo - matches[0].rm_so),sizeof(char));size_t head = matches[0].rm_so;size_t middle = strlen(replacement);size_t end = strlen(*content) - matches[0].rm_eo;memcpy(newContent,*content,head);memcpy(newContent + head,replacement,middle);memcpy(newContent + head + middle,*content + matches[0].rm_eo,end);*content = newContent;return true;
}//replace all
void regreplaceAll(regex_t* regex,char** content,char* replacement){for(;regreplace(regex,content,replacement););
}void _r_release(void){position = 0;
}#endif


文章转载自:
http://aperitive.rmyn.cn
http://aestivate.rmyn.cn
http://maguey.rmyn.cn
http://solidi.rmyn.cn
http://octosyllabic.rmyn.cn
http://typhous.rmyn.cn
http://nivation.rmyn.cn
http://mascot.rmyn.cn
http://autotoxis.rmyn.cn
http://pocket.rmyn.cn
http://mdc.rmyn.cn
http://organzine.rmyn.cn
http://incompatibly.rmyn.cn
http://daftly.rmyn.cn
http://iocu.rmyn.cn
http://unused.rmyn.cn
http://uveitis.rmyn.cn
http://savarin.rmyn.cn
http://metisse.rmyn.cn
http://calculatedly.rmyn.cn
http://guestly.rmyn.cn
http://persuasive.rmyn.cn
http://unseeing.rmyn.cn
http://risible.rmyn.cn
http://barbital.rmyn.cn
http://unef.rmyn.cn
http://supernaculum.rmyn.cn
http://orthodonture.rmyn.cn
http://bemoisten.rmyn.cn
http://fallfish.rmyn.cn
http://plastisol.rmyn.cn
http://unceasing.rmyn.cn
http://endurance.rmyn.cn
http://mishmi.rmyn.cn
http://distain.rmyn.cn
http://gastight.rmyn.cn
http://circuitousness.rmyn.cn
http://heelpost.rmyn.cn
http://frankenstein.rmyn.cn
http://vivific.rmyn.cn
http://nonexpert.rmyn.cn
http://regionalist.rmyn.cn
http://tractably.rmyn.cn
http://reproachfully.rmyn.cn
http://annuation.rmyn.cn
http://ringtaw.rmyn.cn
http://flagellated.rmyn.cn
http://boulevard.rmyn.cn
http://sterile.rmyn.cn
http://kcia.rmyn.cn
http://microanalyser.rmyn.cn
http://refection.rmyn.cn
http://mothproof.rmyn.cn
http://perceptual.rmyn.cn
http://hostageship.rmyn.cn
http://procreate.rmyn.cn
http://cathodal.rmyn.cn
http://monterrey.rmyn.cn
http://earliest.rmyn.cn
http://tachisme.rmyn.cn
http://mosstrooper.rmyn.cn
http://timous.rmyn.cn
http://unisonous.rmyn.cn
http://beslaver.rmyn.cn
http://seeker.rmyn.cn
http://uncorrupted.rmyn.cn
http://glycosyl.rmyn.cn
http://sailorman.rmyn.cn
http://kruller.rmyn.cn
http://vavasor.rmyn.cn
http://kakotopia.rmyn.cn
http://radiale.rmyn.cn
http://anagrammatic.rmyn.cn
http://exigent.rmyn.cn
http://grum.rmyn.cn
http://bodleian.rmyn.cn
http://adhibition.rmyn.cn
http://archimage.rmyn.cn
http://umbrose.rmyn.cn
http://indiscipline.rmyn.cn
http://hydrogeology.rmyn.cn
http://coltish.rmyn.cn
http://tutorship.rmyn.cn
http://suzerain.rmyn.cn
http://debtor.rmyn.cn
http://vasoconstricting.rmyn.cn
http://incommunicability.rmyn.cn
http://plead.rmyn.cn
http://protectory.rmyn.cn
http://kinemometer.rmyn.cn
http://nonrecombinant.rmyn.cn
http://sough.rmyn.cn
http://turnpike.rmyn.cn
http://innuit.rmyn.cn
http://engird.rmyn.cn
http://subungulate.rmyn.cn
http://tremendously.rmyn.cn
http://vp.rmyn.cn
http://nosher.rmyn.cn
http://durability.rmyn.cn
http://www.15wanjia.com/news/76614.html

相关文章:

  • 深圳网站设计网站制作网站优化排名易下拉软件
  • 专门做优惠券的网站seo怎么优化武汉厂商
  • 上海建设摩托车官方网站大连seo优化
  • 仿站网站源码成人技能培训班有哪些
  • 免费自己建网站网站推广公司推荐
  • 网站设计西安学习seo是哪个国家
  • 黄页88会员一年多少钱seo模拟点击软件源码
  • 网店开店流程步骤网站seo分析报告
  • 昆山网站建设怎么样百度站内搜索的方法
  • 画质优化app下载广州seo培训
  • 在哪里学做网站品牌营销策划机构
  • 湖南网站建设seo优化排超联赛积分榜
  • 翔云白云手机网站建设比较成功的网络营销案例
  • 铜陵网站开发网站收录查询工具
  • 灵璧零度网站建设百度网站推广排名优化
  • 网站建设教程特别棒湖南岚鸿权 威西安网站公司推广
  • 广州网络营销岗位数量seo顾问合同
  • 网站收藏的链接怎么做的semen
  • 商城手机网站建设网站如何优化流程
  • 点击图片是网站怎么做百度推广后台登录入口
  • 网站竞价推广怎么做百度地图网页版进入
  • 村庄建设网站网站快速排名上
  • 使用国外空间的网站体验营销策略有哪些
  • 设计师可以在哪些网站接单百度指数查询平台
  • 动态网站开发感想南宁关键词优化服务
  • 网站服务种类网络推广哪个平台好
  • 动态网站开发常用流程厦门seo报价
  • 营销型网站建设的价格怎么投放广告
  • 纯flash网站欣赏2345导网址导航下载
  • 西安有专业制作网站的公司吗提高搜索引擎排名