I need to replace TEXT1-NUMBER with TEXT2-NUMBER. Example "These are TEXT1-123 and TEXT1-456 examples" should be replaced with "These are TEXT2-123 and TEXT2-456 examples".
I can replace most of the cases using
Regexp_Replace(column_name, '(\mTEXT1)(-[0-9]+\M)', 'TEXT2\2', 'g')
But it also replaces some cases that I want to exclude, such as
- TEXT1-NUMBER-NUMBER
- TEXT3-NUMBER-TEXT1-NUMBER
How can I make it to match only exact pairs of TEXT-NUMBER?
Thanks.