Re: Regexp_replace help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday, September 12, 2024, Chris Hoover <chrish@xxxxxxxxxx> wrote:

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.



[Index of Archives]     [Postgresql Home]     [Postgresql General]     [Postgresql Performance]     [Postgresql PHP]     [Postgresql Jobs]     [PHP Users]     [PHP Databases]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Forum]

  Powered by Linux