ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 利用正则批量替换指定字符

利用正则批量替换指定字符

原创 Linux操作系统 作者:czxin788 时间:2015-01-06 20:45:40 0 删除 编辑


想把下面类似certentity="1B@JJ585896219" 中双引号里面的内容全部置为空:


 commonname="" certentity="1B@JJ585896219" ccertsn1="1B200000000000147950" ccertsn2="1B20000000000014794F" ce
 commonname="" certentity="1B@JJ306625580" ccertsn1="1B2000000000001479AA" ccertsn2="1B2000000000001479A9
 commonname="" certentity="1B@JJ062809542" ccertsn1="1B2000000000001479C8" ccertsn2="1B2000000000001479C7" ce
 commonname="" certentity="1B@JJ064893397" cc


解决办法:用vim打开,然后:%s/certentity=".\{14\}"//gi  就可以了

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/28916011/viewspace-1392516/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 主机调优20141226
请登录后发表评论 登录
全部评论

注册时间:2014-06-03

  • 博文量
    233
  • 访问量
    858415