Modify batch HTML code in * .sql file

0

I have a file in * .sql. I needed to batch convert HTML codes with links like this below:

<img src="http://www.sintaema.org.br/site/wp-content/uploads/bomba-456-copy_832-1-pdf-724x1024.jpg"alt="bomba 456 copy_832 1" />'

To look like this:

<a class="link-to-pdf" title="bomba-456-copy_832" href="http://www.sintaema.org.br/site/wp-content/uploads/bomba-456-copy_832-1.pdf" target="_blank" rel="attachment wp-att-11572"><img class="alignnone size-full wp-image-11573 thumb-of-pdf" src="http://www.sintaema.org.br/site/wp-content/uploads/bomba-456-copy_832-1-pdf.jpg"alt="thumbnail of bomba-456-copy_832" width="724" height="1024" /></a>

I initially thought of locating / replacing via notepadd ++, using regular expressions (regex). I've mounted this expression to find, and it's working ok:

(<[?!.:;a-z ="-0123456789_]*uploads/[0-9/0-9]*)([?!.:;a-z ="-0123456789_]*.jpg")( )(alt=)("[?!.:;a-z ="-0123456789_]*")( />)(')

Any suggestion of expression to use in replace?

Or another solution? (There are about 1000 codes, with variable file names!)

    
asked by anonymous 20.09.2016 / 23:49

0 answers