Skip to content
Advertisement

How to replace the word which is not placed between a pattern using Oracle REGEXP and not the same word inside the pattern?

I am trying to replace the word “group” when it’s not between the pattern <a href and a> with “group1” . Below query replaces “group” inside the desired pattern. How to replace the word which is just outside the pattern?

The expected output for the first row is (the word “group” appears inside and outside the pattern). The expectation is to just replace the one which is outside)

Advertisement

Answer

I would be remiss if I did not point everyone reading this to the definitive post on parsing HTML with regex’s: RegEx match open tags except XHTML self-contained tags

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement