Home » excel » html – Regular expression for Notepad++

html – Regular expression for Notepad++

Posted by: admin April 23, 2020 Leave a comment


Long story short, I have a very large table (1200+ rows) from a custom Excel to html conversion, which is working beautifully, except for a final missing part. I’m no good with RegEx, and I think I need it for a Find and Replace in Notepad++. Below is what I have and what I need.



Needed output:

<td><img src="image1.png" alt="" /></td>
<td><img src="image2.png" alt="" /></td>
<td><img src="image1242.png" alt="" /></td>

Please advice!

How to&Answers:

Use this regular expression:


and the following pattern as a replacement:

<td><img src="image.png" alt"" /></td>

As a sidenote, it is usually not a good practice to parse HTML with regular expressions – in simple cases like this, it might be sufficient, but for anything more complicated, it would be much better to parse the HTML like XML file.

If you know some C#, you could use HTML Agility Pack for that.


Do this way:-

Find What:


Replace With:

<td><img src="image.png" alt="" /></td>

Refer the screenshot:

Find Replace with Regex