I want to delete all 2 letter words in a string with several words.
I came up with this solution :
SELECT regexp_replace('UN DE DA ','\s{1}[A-Z]{2}\s{1}',' ','g');
SELECT regexp_replace('UN DE DA ','^[A-Z]{2}\s{1}',' ','g');
SELECT regexp_replace('UN DE DA','[A-Z]{2}$',' ','g');
BUT i would like to have on one regexp_replace instead of three I tested this
SELECT regexp_replace('UN DE DA ','\s{1}[A-Z]{2}\s{1}|^[A-Z]{2}\s{1}|[A-Z]{2}$',' ','g');
but it doesn't work => i still have DE
Your sincerely Loïc