I am having trouble doing a simple replace of a string in QGIS attribute table field calculator. My table has a field "tbljoined_link" that contains HTML links like <a href='islands/luzon.html'>Luzon</a>
. There are, however, several rows that have blank invalid/blank links like <a href='islands/.html'></a>
which I want to remove in bulk.
I have tried using the following expressions but these all inexplicably replace ALL the cells in the "tbljoined_link" field (including <a href='islands/luzon.html'>Luzon</a>
) with NULL
. I have already escaped the single quotes in the expressions below so perhaps the error has something to do with the angle brackets?
replace( "tbljoined_link" ,'<a href=''physical/islands/.html''></a>',null)
regexp_replace( "tbljoined_link" ,'<a href=''physical/islands/\.html''></a>',null )
regexp_replace( "tbljoined_link" ,'^<a href=''physical/islands/\.html''></a>$',null )