SELECT regexp_replace(’This is my second test string and it is causing code1234 from def. The weather is nice. :)’,‘ code[0-9]+? .*’,‘What should this be so I keep the code1234?’)Desire result:‘This is my second test string and it is causing code1234’
Probably easier to just regexp_match “^(.+?code\d+)\b”, and keep the contents of group 1.
David J.