Re: Regexp_replace help

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Regexp_replace help
Дата
Msg-id CAKFQuwaasAeLsZHfdS+3vCAxumLRbyfNHaX7+xbeqjYK-jz5Qw@mail.gmail.com
обсуждение исходный текст
Ответ на Regexp_replace help  (Chris Hoover <chrish@aweber.com>)
Список pgsql-admin
On Thursday, September 12, 2024, Chris Hoover <chrish@aweber.com> 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.


В списке pgsql-admin по дате отправления: