Re: [Urgent] Regexp_replace question

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: [Urgent] Regexp_replace question
Дата
Msg-id 20070925064638.GA34028@winnie.fuhr.org
обсуждение исходный текст
Ответ на [Urgent] Regexp_replace question  ("Phoenix Kiula" <phoenix.kiula@gmail.com>)
Ответы Re: [Urgent] Regexp_replace question  ("Phoenix Kiula" <phoenix.kiula@gmail.com>)
Список pgsql-general
On Tue, Sep 25, 2007 at 01:36:26PM +0800, Phoenix Kiula wrote:
> How can I remove characters that form a part of regular expressions?

Why do you want to do that?

> I would like to remove all instances of the following characters:
>
> [
> ]
> \
> +

test=> select id, t, regexp_replace(t, e'[\\\\[\\]+]', '', 'g') from foo;
 id |     t      | regexp_replace
----+------------+----------------
  1 | foo[]+\bar | foobar
(1 row)

test=> select id, t, translate(t, e'[]\\+', '') from foo;
 id |     t      | translate
----+------------+-----------
  1 | foo[]+\bar | foobar
(1 row)

--
Michael Fuhr

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

Предыдущее
От: "Phoenix Kiula"
Дата:
Сообщение: [Urgent] Regexp_replace question
Следующее
От: Petri Simolin
Дата:
Сообщение: UNIQUE_VIOLATION exception, finding out which index would have been violated