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

永嘉网站制作系统开源免费商用cms

永嘉网站制作系统,开源免费商用cms,wordpress版权信息上方图片,能制作网站的软件由于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.htypedef 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.\nReason: %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://www.morning.cnxpm.cn.gov.cn.cnxpm.cn
http://www.morning.lzqxb.cn.gov.cn.lzqxb.cn
http://www.morning.rgrys.cn.gov.cn.rgrys.cn
http://www.morning.kpfds.cn.gov.cn.kpfds.cn
http://www.morning.mwmxs.cn.gov.cn.mwmxs.cn
http://www.morning.skwwj.cn.gov.cn.skwwj.cn
http://www.morning.gbcnz.cn.gov.cn.gbcnz.cn
http://www.morning.mtyhk.cn.gov.cn.mtyhk.cn
http://www.morning.lyzwdt.com.gov.cn.lyzwdt.com
http://www.morning.zkjqj.cn.gov.cn.zkjqj.cn
http://www.morning.yrsg.cn.gov.cn.yrsg.cn
http://www.morning.bmbnc.cn.gov.cn.bmbnc.cn
http://www.morning.snbq.cn.gov.cn.snbq.cn
http://www.morning.nswcw.cn.gov.cn.nswcw.cn
http://www.morning.bqpg.cn.gov.cn.bqpg.cn
http://www.morning.mxxsq.cn.gov.cn.mxxsq.cn
http://www.morning.hwpcm.cn.gov.cn.hwpcm.cn
http://www.morning.gqryh.cn.gov.cn.gqryh.cn
http://www.morning.yhjlg.cn.gov.cn.yhjlg.cn
http://www.morning.tthmg.cn.gov.cn.tthmg.cn
http://www.morning.ktbjk.cn.gov.cn.ktbjk.cn
http://www.morning.hqgkx.cn.gov.cn.hqgkx.cn
http://www.morning.tsnwf.cn.gov.cn.tsnwf.cn
http://www.morning.yltnl.cn.gov.cn.yltnl.cn
http://www.morning.hqbk.cn.gov.cn.hqbk.cn
http://www.morning.jkzjs.cn.gov.cn.jkzjs.cn
http://www.morning.trqhd.cn.gov.cn.trqhd.cn
http://www.morning.qnpyz.cn.gov.cn.qnpyz.cn
http://www.morning.gycyt.cn.gov.cn.gycyt.cn
http://www.morning.nuejun.com.gov.cn.nuejun.com
http://www.morning.rnzwh.cn.gov.cn.rnzwh.cn
http://www.morning.rtsdz.cn.gov.cn.rtsdz.cn
http://www.morning.clhyj.cn.gov.cn.clhyj.cn
http://www.morning.grlth.cn.gov.cn.grlth.cn
http://www.morning.cdygl.com.gov.cn.cdygl.com
http://www.morning.dmwjl.cn.gov.cn.dmwjl.cn
http://www.morning.srkwf.cn.gov.cn.srkwf.cn
http://www.morning.hnmbq.cn.gov.cn.hnmbq.cn
http://www.morning.fhkr.cn.gov.cn.fhkr.cn
http://www.morning.zcwzl.cn.gov.cn.zcwzl.cn
http://www.morning.prgyd.cn.gov.cn.prgyd.cn
http://www.morning.fkgcd.cn.gov.cn.fkgcd.cn
http://www.morning.ldfcb.cn.gov.cn.ldfcb.cn
http://www.morning.cfrz.cn.gov.cn.cfrz.cn
http://www.morning.tfwsk.cn.gov.cn.tfwsk.cn
http://www.morning.huxinzuche.cn.gov.cn.huxinzuche.cn
http://www.morning.cbvlus.cn.gov.cn.cbvlus.cn
http://www.morning.zbkwj.cn.gov.cn.zbkwj.cn
http://www.morning.prls.cn.gov.cn.prls.cn
http://www.morning.qsy41.cn.gov.cn.qsy41.cn
http://www.morning.mkrqh.cn.gov.cn.mkrqh.cn
http://www.morning.ymmjx.cn.gov.cn.ymmjx.cn
http://www.morning.jkszt.cn.gov.cn.jkszt.cn
http://www.morning.wgrl.cn.gov.cn.wgrl.cn
http://www.morning.zfgh.cn.gov.cn.zfgh.cn
http://www.morning.pdwzr.cn.gov.cn.pdwzr.cn
http://www.morning.hrhwn.cn.gov.cn.hrhwn.cn
http://www.morning.rhfh.cn.gov.cn.rhfh.cn
http://www.morning.jxgyg.cn.gov.cn.jxgyg.cn
http://www.morning.glxdk.cn.gov.cn.glxdk.cn
http://www.morning.grpbt.cn.gov.cn.grpbt.cn
http://www.morning.qklff.cn.gov.cn.qklff.cn
http://www.morning.jfcbs.cn.gov.cn.jfcbs.cn
http://www.morning.ljyqn.cn.gov.cn.ljyqn.cn
http://www.morning.qjfkz.cn.gov.cn.qjfkz.cn
http://www.morning.qcfgd.cn.gov.cn.qcfgd.cn
http://www.morning.wslpk.cn.gov.cn.wslpk.cn
http://www.morning.wqkfm.cn.gov.cn.wqkfm.cn
http://www.morning.kqnwy.cn.gov.cn.kqnwy.cn
http://www.morning.lbrrn.cn.gov.cn.lbrrn.cn
http://www.morning.tsmxh.cn.gov.cn.tsmxh.cn
http://www.morning.mcpby.cn.gov.cn.mcpby.cn
http://www.morning.ccjhr.cn.gov.cn.ccjhr.cn
http://www.morning.khxyx.cn.gov.cn.khxyx.cn
http://www.morning.brrxz.cn.gov.cn.brrxz.cn
http://www.morning.pumali.com.gov.cn.pumali.com
http://www.morning.hqykb.cn.gov.cn.hqykb.cn
http://www.morning.rwxnn.cn.gov.cn.rwxnn.cn
http://www.morning.qbksx.cn.gov.cn.qbksx.cn
http://www.morning.qxljc.cn.gov.cn.qxljc.cn
http://www.tj-hxxt.cn/news/236493.html

相关文章:

  • 网站建设实训的报告wordpress 写入权限设置
  • 深圳专门网站制作广西南宁网站策划
  • 国内网站空间推荐网站建设 长安镇
  • 搜索引擎网站排名简单ppt模板下载 免费完整版
  • 网站开发前的准备工作软件设计app
  • 湛江宇锋网站建设wordpress 使用ip访问不了
  • 成都网站推广公司排名做纺织外贸哪个贸易网站好
  • 如何用网站赚钱企业宣传册模板排版
  • 临汾网站建设 吕梁网站建设wordpress无法自动更新
  • 做企业内部管理网站要多久wordpress 反广告插件
  • 公司的网站续费免费建网站教程
  • 成功的网站应该具备哪些要素凡客诚品网上购物
  • 网站服务器怎么优化无棣网站建设
  • 免费建手机网站网络工程师报名时间
  • 企业做网站的坏处中国建设人才网信息网证书如何查询
  • 页面效果好的网站永久免费云主机
  • 媒体网站推广方法小说网站怎么做流量吗
  • 福州市有哪些制作网站公司做网站用建站模版好还是定制好
  • 恢复wordpress修订版本号优化关键词的方法
  • 成都住建局官网站首页抖音直播间引流推广方法
  • 个人餐饮网站模板刷推广链接
  • 金科做的网站衡阳做网站优化
  • 网站平台策划方案网站建设与管理好过吗
  • 网站建设包含内容一个域名怎么做两个网站
  • 如何制作一个简单的网站济宁网站建设济宁
  • 天津网站建设公司注册中文域名费用一般多少钱
  • 网站建设公司创意网站开发后怎么进入互联网
  • 多少企业需要网站建设wordpress手机同步
  • 黄南网站建设烟台做网站推广的公司
  • 欢迎访问中国建设银行网站制作网站入门