简体   繁体   English

notepad ++ regex将“00”替换为“01”,“02”,“03”等

[英]notepad++ regex replace “00” with “01”, “02”, “03” etc

I have a file which repeats the same code, but now I would like to use Regex to replace the "00" where it is found, but increment each time. 我有一个重复相同代码的文件,但现在我想用Regex替换找到它的“00”,但每次都增加。

Here is the original file: 这是原始文件:

<li onclick="tab.location.href='http://stackoverflow.com'" style="text-align: center;"><b>ep 00</b></li>

<li onclick="tab.location.href='http://stackoverflow.com/'" style="text-align: center;"><b>ep 00</b></li>

<li onclick="tab.location.href='http://stackoverflow.com/'" style="text-align: center;"><b>ep 00</b></li>

I want to use regex in notepad++ to make it like this : 我想在notepad ++中使用正则表达式来使它像这样:

<li onclick="tab.location.href='http://stackoverflow.com'" style="text-align: center;"><b>ep 00</b></li>

<li onclick="tab.location.href='http://stackoverflow.com/'" style="text-align: center;"><b>ep 01</b></li>

<li onclick="tab.location.href='http://stackoverflow.com/'" style="text-align: center;"><b>ep 02</b></li>

i want to change "ep 00" inside the tag to be ep 01, ep 02, ep 03 ... ep 711 etc .... 我想将标签内的“ep 00”更改为ep 01,ep 02,ep 03 ... ep 711等....

Thanks 谢谢

as said before on the comments. 正如之前所说的评论。 Regex is not able of such task ... you can do though using a calc program ... OpenOffice Calc LibreOffice Calc BrOffice.org Calc Microsoft Office Excell you just need to something like this 正则表达式是不能够这样的任务的......你可以做虽然使用计算程序... OpenOffice的Calc中的LibreOffice Calc的BrOffice.org Calc中的Microsoft Office的Excell你只需要像这样

or the js solution 或者是js解决方案

var holderelement=document.body;
var howmanylinksyouwant=3;
for (var i=0;i<howmanylinksyouwant;i++){
var li=document.createElement("li");
li.onclick=function(){location.href="stackoverflow.com";}
li.style.textAlign="center";
li.innerHTML="<b>ep "+i+"</b>" holderelement.append(li);
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM