I have string like this: aa/ss/[img]aa/ss/dd[/img][img]aa/ss/dd[/img]aa/ss
I need replace this piece /ss/
with this: /WW/
but only when they are between [img]
tags. result must be:
aa/ss/[img]aa/WW/dd[/img][img]aa/WW/dd[/img]aa/ss
I am trying this:
select regexp_replace('aa/ss/[img]aa/ss/dd[/img][img]aa/ss/dd[/img]aa/ss', '(\[img\].*/)ss(/.*\[\/img\])', '\1WW\2', 'g')
But this replaces just one piece, not both. I use 'g'
flag buth same result.
How to do this correctly ?