1
0
I have big file catering to 1000+ span class for pagenumbers. I would like to remove the complete syntax with the text in notepad++ through a ReGex. Example,<p>Cillacepro di to tem endelias eaquunto maximint eostrum eos dolorit et laboria estiati<span class=”pagenum”><a name=”Page_4” id=”Page_4”>[Pg 4]</a></span>Cillacepro di to tem endelias</p>
I would to replace <span class=”pagenum”><a name=”Page_4” id=”Page_4”>[Pg 4]</a></span>
with " " such that it finds the pattern for two and three digits, as well. I am new to this regex string search therefore, I would be grateful if anyone could help me with a replace string for the same.
Regards,
Aman Mittal
It is not clear what you are trying to find and what you want to replace it with, so I suggest you look at this tutorial.
– AFH – 2018-05-22T13:42:06.493Hi, Thank you for the reply. I am simply trying to replace <span class=”pagenum”><a name=”Page_4” id=”Page_4”>[Pg 4]</a></span> with a space. I am looking for a regex search string that that remove all the page numbers at once so that I don't have to manually remove each syntax one by one. – Aman Mittal – 2018-05-22T14:10:00.367
1I imagine that matching
<span class="pagenum">.*?</span>
will be sufficient, as only this span class is likely to contain the page number data you want to eliminate. Note that.*?
will match the minimum number of arbitrary characters, ensuring the that the</span>
in the match is paired with the same leading<span ...>
. – AFH – 2018-05-22T17:14:13.767Thank you so much for taking out the time and providing a solution. It worked wonders for me. I am too grateful to you. Thanks a lot! Stay blessed! – Aman Mittal – 2018-05-23T05:14:11.710
@AFH I wish I could like your profile and let everyone know how great of a person you are. Thanks a lot! – Aman Mittal – 2018-05-23T05:21:34.627
@AFH: I am sorry to trouble you again. But in my project, I cam across another type of page number span: <span class="tei tei-pb" id="page001">[pg 001]</span><a name="Pg001" id="Pg001" class="tei tei-anchor"></a> I tried this code to find them all at once: <span class="tei tei-pb" id="page\d+">[pg \d+]</span><a name="Pg\d+" id="Pg\d+" class="tei tei-anchor"></a> However, it does not seem to work. Could you please let me know the errors in the regex search? I would be highly obliged to you. – Aman Mittal – 2018-05-25T04:41:25.757
Also, If I would like to search for roman number - i, ii, iii... in the same regex then how would I go about it? – Aman Mittal – 2018-05-25T04:43:52.027