I have a table to store substitutions which is including two fields, the first one is to store the word, the second is to store the substitutions. I know the creation of the table is not a suitable approach, but it is already in place and used by other systems.
The table look like the following:
WORD SUBS_LIST
------------------------------------
MOUNTAIN MOUNTAIN, MOUNT, MT, MTN
VIEW VIEW, VU
FIFTH V, 5TH
YOU EWE, U , YEW
ROW ROW , ROE
ONE UN , ONE
Then, when a name comes in it is substitute according to the table. I was able to the previous on Oracle using regexp_like. However, I would like to apply the same in Postgresql. I have attempt using ~ to replace regexp_like and regexp_matches without success.
Please find here the DB<>Fiddle which I have tried so far.
Thank you for your help :)